Skip to content

Commit

Permalink
Merge github.com:hackerdojo/hd-maglock
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie committed Jul 29, 2010
2 parents 663ee66 + 5c9e0b8 commit d05e45c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions maglocker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/local/bin/python
import sys, os, simplejson
from twisted.python import log
from twisted.internet import reactor, serialport
from twisted.web import client as http, error as http_error
from twisted.protocol import basic

class RelayProtocol(basic.LineReceiver):
# Here's an echo implementation to show you read/write
def lineReceived(self, line):
self.sendLine(self, line)


if __name__ == "__main__":
log.startLogging(sys.stdout)
device = "/dev/ttyS0"
baudrate = 4800
serialport.SerialPort(RelayProtocol(), device, reactor, baudrate=baudrate)
reactor.run()

0 comments on commit d05e45c

Please sign in to comment.