Switches |
'{ $STAMP BS2 } INPUT 0 'make I/O pin 0 an input loop: PAUSE 400 'sleep for 400 milliseconds IF IN0 = 0 THEN low 'pin high ... so something GOTO loop low: 'pin low ... so something GOTO loop |
BUTTON Pin, DownState, Delay, Rate, Workspace, TargetState, Address
where:
'{ $STAMP BS2 } nouse VAR BYTE 'workspace variable for BUTTON instruction loop: BUTTON 0, 0, 255, 250, nouse, 0, nopress 'branch to nopress unless pin0 = 0 DEBUG "* " nopress: GOTO loop |