chickenhouse/gate_guard/__init__.py

22 lines
328 B
Python
Raw Normal View History

2016-12-20 21:09:01 +00:00
'''
Created on Dec 19, 2016
2016-12-19 15:38:30 +00:00
2016-12-20 21:09:01 +00:00
@author: klaehn
'''
2016-12-19 15:38:30 +00:00
import time
import gate
2016-12-19 15:38:30 +00:00
2016-12-20 21:09:01 +00:00
def main():
gate_state = gate.Gate()
2016-12-20 21:09:01 +00:00
try:
while True:
gate_state.poll()
time.sleep(0.1)
2016-12-19 15:38:30 +00:00
2016-12-20 21:09:01 +00:00
except KeyboardInterrupt:
print "key exit"
return None
2016-12-19 15:38:30 +00:00
if __name__ == "__main__":
2016-12-20 21:09:01 +00:00
sys.exit(main())