]> vault307.fbx.one Git - garage_door_sensor.git/blob - garageStatus.py
update distanceLux.py to account for senstitivity of lux sensor
[garage_door_sensor.git] / garageStatus.py
1 #!/usr/bin/python3
2 import serial, time
3
4 ser=serial.Serial('/dev/ttyACM0',9600,timeout=.5)
5
6 l='' #lightsensor
7 g='' #garagedoor sensor
8
9 def readLine():
10 global l
11 global g
12 data=str(ser.readline())
13 l=data[2]
14 g=data[4]
15 return l
16 return g
17
18 while True:
19 readLine()
20 print(l,g)
21 time.sleep(1)