Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

generic function is generic

  • Loading branch information...
commit 1eedb693dba92d291e54c22738329e620c6e722b 1 parent ad8cce0
bluehat authored
Showing with 46 additions and 10 deletions.
  1. +46 −10 writeSign.py
View
56 writeSign.py
@@ -5,13 +5,36 @@
#signfile = serial.Serial('/dev/ttyUSB0',baudrate=9600,stopbits=1,xonxoff=1,rtscts=0,timeout=0,parity='N',dsrdtr=0)
styles = {
- "scroll_stuck" : "<FM>",
- "center" : "<FB>",
+ "instant" : "<FB>",
+ "scroll_bottom" : "<FC>",
+ "in_place_right" : "<FD",
+ "from_center_h" : "<FE>",
+ "from_center_v" : "<FF>",
"scroll_always" : "<FH>",
+ "invisible" : "<FM>",
+ "" : "",
}
-def tosign(id, top_style, top_note, bottom_style, bottom_note):
- signfile.write("\x0D\x0A\x0A")
+def textToSign(id, top_style, top_note, bottom_style, bottom_note, page):
+ signfile.write("<ID" + str(id) + ">")
+ signfile.write("<P"+page+">")
+ signfile.write(styles.get(top_style))
+ if bottom_note:
+ signfile.write("<L1>")
+ signfile.write(top_note)
+ if bottom_note:
+ signfile.write("<L2>")
+ signfile.write(styles.get(bottom_style))
+ signfile.write(bottom_note)
+ signfile.write("\r\n")
+ signfile.write("<ID" + str(id) + ">")
+ signfile.write("<RP" + page + ">")
+ time.sleep(1)
+ signfile.write("\x0C")
+
+
+
+''' signfile.write("\x0D\x0A\x0A")
signfile.write(" <ID"+str(id)+"><PZ>")
signfile.write(styles.get(top_style))
signfile.write("<L1>")
@@ -24,15 +47,15 @@ def tosign(id, top_style, top_note, bottom_style, bottom_note):
signfile.write("\x0D\x0A")
time.sleep(1)
signfile.write("\x0C")
-
+'''
def formTweet(sign, tweet):
tosign(sign, "center", '@'+tweet['user']['screen_name'].upper(), "scroll_always", tweet['text'])
signfile = serial.Serial('/dev/ttyUSB0',baudrate=9600)
-tosign(30, "center", "", "center", "Please tweet at me!")
-tosign(40,"center", "", "center", "")
-tosign(73,"center", "", "center", "")
-words = ["oil","dojosign","hackerdojo","hacker dojo","#dojosign"]
+#tosign(30, "center", "", "center", "Please tweet at me!")
+#tosign(40,"center", "", "center", "")
+#tosign(73,"center", "", "center", "")
+'''words = ["oil","dojosign","hackerdojo","hacker dojo","#dojosign"]
p = ""
pp = ""
with tweetstream.TrackStream("dojosign", "dojo77", words) as stream:
@@ -49,7 +72,20 @@ def formTweet(sign, tweet):
if p:
pp = p
p = tweet
- time.sleep(10)
+ time.sleep(10)'''
+'''
+#signfile.write("<ID73><GY>11111111111111111111111111111111111111111111")
+#signfile.write("\x0D\x0A")
+signfile.write("<ID73>")
+signfile.write("<V>")
+#signfile.write("\r\n<ID73><RPZ>")
+signfile.write("\x0D\x0A")
+print signfile.readline()
+time.sleep(1)
+signfile.write("\x0C")
+'''
+
+textToSign(73, "", "\x7F", "", "", "A")
signfile.close()
Please sign in to comment.
Something went wrong with that request. Please try again.