mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
parent
0fb8a1a2a0
commit
2700a2c300
@ -33,6 +33,12 @@ def Measure():
|
||||
Main()
|
||||
while GPIO.input(ECHO)==1:
|
||||
stop = time.time()
|
||||
Dif = time.time() - realstart
|
||||
if Dif > 5:
|
||||
print("Ultrasonic Sensor Timed out, Restarting.")
|
||||
time.sleep(0.4)
|
||||
Main()
|
||||
|
||||
elapsed = stop-start
|
||||
distance = (elapsed * 36000)/2
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user