Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 89 lines (82 sloc) 2.12 KB
#!/usr/bin/python
import smbus
import time
import gawRelayHandler
# Device address - defaults to 0x20
boardAddress = 0x20 # Device address (20-27)
relayHandler = gawRelayHandler.relayHandler()
#for MyData in range(0,256):
while 1:
for MyData in [ \
"0000000000000000", \
"1000000000000001", \
"1100000000000011", \
"1110000000000111", \
"1111000000001111", \
"1111100000011111", \
"1111110000111111", \
"1111111001111111", \
"1111111111111111", \
"0111111111111110", \
"0011111111111100", \
"0001111111111000", \
"0000111111110000", \
"0000011111100000", \
"0000001111000000", \
"0000000110000000", \
"0000000000000000", \
"0000000110000000", \
"0000001111000000", \
"0000011111100000", \
"0000111111110000", \
"0001111111111000", \
"0011111111111100", \
"0111111111111110", \
"1111111111111111", \
"0111111111111110", \
"0011111111111100", \
"0001111111111000", \
"0000111111110000", \
"0000011111100000", \
"0000001111000000", \
"0000000110000000", \
"0000000000000000", \
"1000000000000000", \
"0100000000000000", \
"0010000000000000", \
"0001000000000000", \
"0000100000000000", \
"0000010000000000", \
"0000001000000000", \
"0000000100000000", \
"0000000010000000", \
"0000000001000000", \
"0000000000100000", \
"0000000000010000", \
"0000000000001000", \
"0000000000000100", \
"0000000000000010", \
"0000000000000001", \
"0000000000000010", \
"0000000000000100", \
"0000000000001000", \
"0000000000010000", \
"0000000000100000", \
"0000000001000000", \
"0000000010000000", \
"0000000100000000", \
"0000001000000000", \
"0000010000000000", \
"0000100000000000", \
"0001000000000000", \
"0010000000000000", \
"0100000000000000", \
"1000000000000000", \
"0000000000000000" \
]:
# Count from 1 to 16 which in binary will count
# from 0000 to 1111
for pos in range(0,16):
EenOfNul = int(MyData[pos])
relayHandler.setRelay(boardAddress,pos,EenOfNul)
time.sleep(0.05)