DIRS=%0000111111111100 '//make pins 2 to 11 outputs press VAR Nib light VAR Word '//variable to switch the output pins light=0 main: DEBUG BIN16 light,CR '//display the 16 bits of the light variable DEBUGIN press IF press=2 THEN GOSUB reset ELSEIF light<4093 THEN '//if light = 4092 then all lights are on light=(light<<1)+4 '//shift all the bits left 1 place and stick one on the end ENDIF GOTO main reset: light=0 RETURN