From 13fbfc4f222ed19d67b8d5072048078b3148a699 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Mon, 8 May 2017 09:01:45 +0100 Subject: [PATCH] bump PiSRF node to fix timeout Thanks @bartbutenaers to Close #309 --- hardware/PiSrf/nrsrf.py | 6 +++--- hardware/PiSrf/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hardware/PiSrf/nrsrf.py b/hardware/PiSrf/nrsrf.py index 945c497f..e226d1df 100755 --- a/hardware/PiSrf/nrsrf.py +++ b/hardware/PiSrf/nrsrf.py @@ -34,9 +34,9 @@ def Measure(): while GPIO.input(ECHO)==1: stop = time.time() Dif = time.time() - realstart - if Dif > 5: + if Dif > 0.4: print("Ultrasonic Sensor Timed out, Restarting.") - time.sleep(0.4) + time.sleep(0.2) Main() elapsed = stop-start @@ -71,7 +71,7 @@ if len(sys.argv) > 1: distance = int( Measure() + 0.5 ) if distance != OLD: print(distance) - OLD = distance + OLD = distance time.sleep(0.5) except: # try to clean up on exit print("0.0"); diff --git a/hardware/PiSrf/package.json b/hardware/PiSrf/package.json index 0bafe01c..57acdf95 100644 --- a/hardware/PiSrf/package.json +++ b/hardware/PiSrf/package.json @@ -1,6 +1,6 @@ { "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", "dependencies" : { },