Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:nycresistor/Hexascroller

  • Loading branch information...
commit 763f8f847b672a86ac9ba950f0f72721affa19d6 2 parents a0a04e5 + bf7f15b
@phooky phooky authored
Showing with 20 additions and 12 deletions.
  1. +1 −1  hexaservice/led_panel.py
  2. +19 −11 hexaservice/service.py
View
2  hexaservice/led_panel.py
@@ -46,7 +46,7 @@ def setRelay(self, on):
def setMessage(self, message, x =0, y =0):
message = message[:120]
- cmd = struct.pack("bb",x,y))+message
+ cmd = struct.pack("bb",x,y)+message
self.command(CC_TEXT,cmd,0)
def getID(self):
View
30 hexaservice/service.py
@@ -1,20 +1,28 @@
-import led_panels
-from led_panels import panels
+#!/usr/bin/python
+import led_panel
+from led_panel import panels
import time
+import signal
+import sys
class ServiceThread:
pass
if __name__=="__main__":
- led_panels.init()
-
- panels[0].setRelay(true)
-
- for i in range(100):
+ led_panel.init()
+ panels[0].setRelay(True)
+ def sigint_handler(signal,frame):
+ print("Caught ctrl-C; shutting down.")
+ panels[0].setRelay(False)
+ led_panel.shutdown()
+ sys.exit(0)
+ signal.signal(signal.SIGINT,sigint_handler)
+ while True:
+ msg = time.strftime("%H:%M:%S")
for j in range(3):
- panels[j].setMessage("Test:"+str(i),i,0)
- time.delay(0.333)
+ panels[j].setMessage(msg,0,0)
+ time.sleep(0.15)
- panels[0].setRelay(false)
+ panels[0].setRelay(False)
- led_panels.shutdown()
+ led_panel.shutdown()
Please sign in to comment.
Something went wrong with that request. Please try again.