Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: bluehat/Airport-Sign-Code
base: master
...
head fork: merriam/Airport-Sign-Code
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jun 27, 2010
chasm Added one file to print the demo message, takes a chr13 for no known …
…reason.

Other is a fuzz based on R+numbers for the funky characater mapping.
cb4e79f
Showing with 94 additions and 38 deletions.
  1. +37 −38 writeSign.py
  2. +57 −0 writeSign2.py
View
75 writeSign.py
@@ -1,55 +1,54 @@
import serial
-import tweetstream
+#import tweetstream
import time
+import random
#signfile = serial.Serial('/dev/ttyUSB0',baudrate=9600,stopbits=1,xonxoff=1,rtscts=0,timeout=0,parity='N',dsrdtr=0)
-
+signs = "30", "40", "73"
+my_sign = signs[1]
styles = {
"scroll_stuck" : "<FM>",
"center" : "<FB>",
"scroll_always" : "<FH>",
}
-def tosign(id, top_style, top_note, bottom_style, bottom_note):
- signfile.write("\x0D\x0A\x0A")
- signfile.write(" <ID"+str(id)+"><PZ>")
- signfile.write(styles.get(top_style))
- signfile.write("<L1>")
- signfile.write(top_note)
- signfile.write("<L2>"+bottom_note)
- signfile.write(styles.get(bottom_style))
- signfile.write("\x0D\x0A")
- signfile.write(" ")
- signfile.write("<ID"+str(id)+"><RPZ>")
- signfile.write("\x0D\x0A")
+code = { "start" : "\x0D\x0A\x0A",
+ "id" : "<ID" + my_sign+ ">",
+ "center" : "<FB>",
+ "top" : "<L1>",
+ "scroll_always" : "<FH>",
+ "scroll_stuck" : "<FM>",
+ "end" : "\x0D\x0A"
+ }
+c = code
+
+def outs(v):
+ return c['start'] + ' ' + c['id'] + "<PZ>" + '<FB>' + '<R' + v + '' + "is " + v \
+ + c['end'] + ' ' + c['id'] + '<RPZ>' + c['end']
+
+def nextline():
+ while True:
+ x = ""
+ for z in range(0, 64):
+ x = x + chr(z) + chr(z) + chr(z)
+ if len(x) >= 3:
+ yield x
+ x = ""
+ yield x
+
+
+def tosign(s) :
+ signfile.write(s)
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"]
-p = ""
-pp = ""
-with tweetstream.TrackStream("dojosign", "dojo77", words) as stream:
- for tweet in stream:
- if type(tweet['text']) is str:
- print tweet['user']['screen_name']+": "+tweet['text']
- print "\n"
- if "oil" in tweet['text']:
- formTweet(30, tweet)
- if p:
- formTweet(40, p)
- if pp:
- formTweet(73, pp)
- if p:
- pp = p
- p = tweet
- time.sleep(10)
+
+for v in nextline():
+ print "V = ", v, ord(v[0])
+ tosign(outs(v))
+ time.sleep(5)
+
signfile.close()
View
57 writeSign2.py
@@ -0,0 +1,57 @@
+import serial
+#import tweetstream
+import time
+import random
+
+#signfile = serial.Serial('/dev/ttyUSB0',baudrate=9600,stopbits=1,xonxoff=1,rtscts=0,timeout=0,parity='N',dsrdtr=0)
+signs = "30", "40", "73"
+my_sign = signs[1]
+styles = {
+ "scroll_stuck" : "<FM>",
+ "center" : "<FB>",
+ "scroll_always" : "<FH>",
+}
+
+code = { "start" : "\x0D\x0A\x0A",
+ "id" : "<ID" + my_sign+ ">",
+ "center" : "<FB>",
+ "top" : "<L1>",
+ "scroll_always" : "<FH>",
+ "scroll_stuck" : "<FM>",
+ "end" : "\x0D\x0A"
+ }
+c = code
+
+def outs(v):
+ return c['start'] + ' ' + c['id'] + "<PZ>" + v + "<" + '13' + ">" + "is " + v \
+ + c['end'] + ' ' + c['id'] + '<RPZ>' + c['end']
+
+def nextline():
+ while True:
+ x = ""
+ for z in range(13, 256):
+ yield chr(int(z))
+ yield x
+
+
+def tosign(s) :
+ signfile.write(s)
+ time.sleep(1)
+ signfile.write("\x0C")
+
+signfile = serial.Serial('/dev/ttyUSB0',baudrate=9600)
+
+for v in nextline():
+ print "V = ", v, ord(v)
+ tosign(outs(v))
+ time.sleep(112)
+
+
+signfile.close()
+
+
+
+#signfile.write("\n\n<ID40><PZ><FB><L1>BBB<FP5><L2>AAA<FH>\n")
+#signfile.write("<ID40><RPZ>")
+#signfile.write("\x0C")
+#signfile.close()

No commit comments for this range

Something went wrong with that request. Please try again.