home *** CD-ROM | disk | FTP | other *** search
- ' use with SoftStep TestBasicStamp
- ' receives a value 0-127 from SoftStep, inverts it to 127-0, and sends it back,
- ' LED attached to output 0 blinks when no data
- ' LEDs attached to outputs 0-6 count when data received
-
- value VAR byte
- value = 0
-
- output 0
- output 1
- output 2
- output 3
- output 4
- output 5
- output 6
-
- NoData:
- out1 = 1
- out2 = 1
- out3 = 1
- out4 = 1
- out5 = 1
- out6 = 1
-
- out0 = 0
- pause 50
- out0 = 1
- Loop:
- SERIN 16, 16468, 500, NODATA, [DEC value]
-
- out0 = ~(value & 1)
- out1 = ~((value & 2) / 2)
- out2 = ~((value & 4) / 4)
- out3 = ~((value & 8) / 8)
- out4 = ~((value & 16) / 16)
- out5 = ~((value & 32) / 32)
- out6 = ~((value & 64) / 64)
-
- value = 127 - value
-
- SEROUT 17, 16468, [dec3 value]
- goto Loop
-
-