2 import time, socket, atexit
3 import RPi.GPIO as GPIO
5 tuerSock = "/run/tuer.sock"
9 GPIO.setmode(GPIO.BOARD)
10 GPIO.setup(ringPin, GPIO.IN)
11 atexit.register(GPIO.cleanup);
17 GPIO.wait_for_edge(ringPin, GPIO.BOTH)
18 # measure time since event
20 timePassed = now-lastEvent
21 print("Time between events %f" % timePassed)
25 if timePassed >= 1.5 and timePassed <= 3:
28 s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
35 print("Received unexpected answer %s" % str(data))