Parallax, Inc. • BS2p “Plus Pack” (#45184) • 10/2001
Page 52
LED_Off:
DEBUG "LED..... Off"
IF (status = Off) THEN Show_Flags ' if off, shake flags
GOTO Toggle_LED ' otherwise, turn off
LED_On:
DEBUG "LED..... On "
IF (status = On) THEN Show_Flags ' if on, shake flags
GOTO Toggle_LED ' otherwise, turn on
' -----[ Subroutines ]----------------------------------------------------------
'
Shake_Flags:
FOR idx = 0 TO 15 ' let all bits change
RANDOM rndValue
NEXT
RETURN
Toggle_LED:
OWOUT OWpin, OW_FERst, [MatchROM, STR romData\8]
OWIN OWpin, OW_B OW_BERst, [status] ' get new status
GOTO Show_Flags