Permalink
Browse files

relay on

  • Loading branch information...
1 parent 6df3ae4 commit 7b1d819848ecf30b77dfdebe2d65cf66c38dee1b @phooky phooky committed Mar 19, 2013
Showing with 7 additions and 5 deletions.
  1. +7 −5 scripts/panels.py
View
@@ -39,16 +39,18 @@ def close(self):
self.serialPort.close()
panels = [None]*3
-for port in range(0,2):
+for port in range(0,3):
name = "/dev/ttyACM{0}".format(port)
p = Panel()
p.open(name)
v = p.command(CC_GET_ID,"",1)
- print("{0} - {1}",name,ord(v[0]))
- p.close()
+ id = ord(v[0])
+ panels[id] = p
+
+panels[0].command(CC_RELAY,struct.pack("B",1),0)
-#for p in panels:
-# p.close()
+for p in panels:
+ p.close()

0 comments on commit 7b1d819

Please sign in to comment.