Skip to content

Commit

Permalink
Adds code for rpiEHC#8 to test on Pi
Browse files Browse the repository at this point in the history
  • Loading branch information
theopak committed Nov 29, 2012
1 parent b77b76c commit f57588b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,21 +475,21 @@ class TagReader(object):
The RFID reader is on Github at rpiEHC/RPI-RFID
'''

ser = None # Serial port interface object
port = None # Serial port location
baud = 9600 # Clock rate of port

def __init__(self, port='/dev/ttyACM0', baud=9600):
self.port = port # USB0 is '/dev/ttyUSB0'... that's not what we want.
self.baud = baud # 9600 baud is standard
def __init__(self, port='/dev/ttyACM0', baud=9600, time=0):
self.ser = serial.Serial(port, baud, timeout=time)
return

def get(self):
'''
Poll the reader over the configured serial connection and return the
valid result read, which is the uid of the person on the RFID card.
'''
# todo
uid = 123456789
uid = '--NO CHANGE--'
uid = self.ser.readline()
print 'TagReader.get() returns '+str(uid)
return uid

Expand Down Expand Up @@ -538,4 +538,4 @@ def test_rfid():

test_db()
test_purchase()
test_rfid()
#test_rfid()

0 comments on commit f57588b

Please sign in to comment.