mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
parent
2700a2c300
commit
13fbfc4f22
@ -34,9 +34,9 @@ def Measure():
|
|||||||
while GPIO.input(ECHO)==1:
|
while GPIO.input(ECHO)==1:
|
||||||
stop = time.time()
|
stop = time.time()
|
||||||
Dif = time.time() - realstart
|
Dif = time.time() - realstart
|
||||||
if Dif > 5:
|
if Dif > 0.4:
|
||||||
print("Ultrasonic Sensor Timed out, Restarting.")
|
print("Ultrasonic Sensor Timed out, Restarting.")
|
||||||
time.sleep(0.4)
|
time.sleep(0.2)
|
||||||
Main()
|
Main()
|
||||||
|
|
||||||
elapsed = stop-start
|
elapsed = stop-start
|
||||||
@ -71,7 +71,7 @@ if len(sys.argv) > 1:
|
|||||||
distance = int( Measure() + 0.5 )
|
distance = int( Measure() + 0.5 )
|
||||||
if distance != OLD:
|
if distance != OLD:
|
||||||
print(distance)
|
print(distance)
|
||||||
OLD = distance
|
OLD = distance
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
except: # try to clean up on exit
|
except: # try to clean up on exit
|
||||||
print("0.0");
|
print("0.0");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-pisrf",
|
"name" : "node-red-node-pisrf",
|
||||||
"version" : "0.0.3",
|
"version" : "0.0.4",
|
||||||
"description" : "A Node-RED node for a Raspberry Pi to use a SRF04 or SRF05 range finder",
|
"description" : "A Node-RED node for a Raspberry Pi to use a SRF04 or SRF05 range finder",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user