forked from anna/doors
Move main loop into a new function
This lets the simulator drop to the command line rather than looping. Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
d20813b4ff
commit
668260c7b2
17
doors.py
17
doors.py
|
@ -117,9 +117,14 @@ def read_rfid():
|
|||
RFID_SERIAL.flushInput() # ignore errors, no data
|
||||
|
||||
|
||||
while True:
|
||||
try:
|
||||
read_rfid()
|
||||
except Exception(e):
|
||||
door_close()
|
||||
print(e)
|
||||
|
||||
def main():
|
||||
while True:
|
||||
try:
|
||||
read_rfid()
|
||||
except Exception as e:
|
||||
door_close()
|
||||
print(e)
|
||||
|
||||
|
||||
if __name__ == "__main__": main()
|
||||
|
|
Loading…
Reference in New Issue