Datasheet

Chapter 2: EEPROM Tricks and Program Tips ยท Page 73
DEBUG "five"
ENDSELECT
ENDIF
ResetTest:
DEBUG CR, "Done!" ' Verify we made it to main.
END
' -----[ Subroutine - Reset ]-------------------------------------------------
Reset:
READ RunStatus, temp ' Byte @RunStatus -> temp
temp = temp + 1 ' Increment temp
WRITE RunStatus, temp ' Store new value for next time
IF (temp.BIT0 = 1) THEN ' Examine temp.BIT0
DEBUG CLS, "Press/release Reset", CR, ' 1 -> end, 0 -> keep going
"button..."
END
ELSE
DEBUG CR, "Program running..."
ENDIF
RETURN
' -----[ Subroutine - Start_Delay ]-------------------------------------------
Start_Delay:
FOR counter = 1 TO 5 ' 5 beeps, 1/second
PAUSE 900
FREQOUT LedSpeaker, 100, 3000
NEXT
RETURN
' ---> Pasted from PushbuttonMode.bs2 (Mode_Select subroutine) <---
' -----[ Subroutine - Mode_Select ]-------------------------------------------
' Selects mode of operation
Mode_Select:
DEBUG CR, ' Display user instructions
CR, "Release pushbutton after",
CR, "number of beeps to select",
CR, "mode (1 to 5)."
FOR temp = 1 TO 5 ' Cycle 5 times
FOR counter = 1 TO temp ' temp beeps, 1/second