Thursday, November 29, 2007
interactive data
This script allows data from the mysql data base to be compared with a user input in this case a on/off switch.
' {$STAMP BS2}
' {$PBASIC 2.5}
check VAR Byte
proIn VAR Byte
checks VAR Byte
cnt VAR Byte
Main:
DO
check = IN3
proIn = IN10
'loop through all tiles
cnt = 0
FOR checks = 0 TO 8
IF IN3 = 0 THEN
cnt = cnt + 1
ENDIF
NEXT
SERIN 16, 16780, [proIn]
IF proIn > 13 THEN
IF cnt > 0 THEN
HIGH 14
ENDIF
ENDIF
IF proIn < 13 THEN
LOW 14
ENDIF
checks = 0
LOOP
END
' {$STAMP BS2}
' {$PBASIC 2.5}
check VAR Byte
proIn VAR Byte
checks VAR Byte
cnt VAR Byte
Main:
DO
check = IN3
proIn = IN10
'loop through all tiles
cnt = 0
FOR checks = 0 TO 8
IF IN3 = 0 THEN
cnt = cnt + 1
ENDIF
NEXT
SERIN 16, 16780, [proIn]
IF proIn > 13 THEN
IF cnt > 0 THEN
HIGH 14
ENDIF
ENDIF
IF proIn < 13 THEN
LOW 14
ENDIF
checks = 0
LOOP
END
Labels: mf