From 05a931290559cc4d894fc285ab52f31ca4393d9f Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sat, 9 May 2020 16:51:22 +0100 Subject: [PATCH] fix gpio initial read timing and order --- hardware/PiGpio/nrgpio.py | 3 ++- hardware/PiGpio/package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hardware/PiGpio/nrgpio.py b/hardware/PiGpio/nrgpio.py index 26bb595a..52ee3ab0 100755 --- a/hardware/PiGpio/nrgpio.py +++ b/hardware/PiGpio/nrgpio.py @@ -118,11 +118,12 @@ if len(sys.argv) > 2: else: GPIO.setup(pin,GPIO.IN) - print(GPIO.input(pin)) if bounce > 0: GPIO.add_event_detect(pin, GPIO.BOTH, callback=handle_callback, bouncetime=int(bounce)) else : GPIO.add_event_detect(pin, GPIO.BOTH, callback=handle_callback) + sleep(0.1) + print(GPIO.input(pin)) while True: try: diff --git a/hardware/PiGpio/package.json b/hardware/PiGpio/package.json index 8b6047af..8578fd2b 100644 --- a/hardware/PiGpio/package.json +++ b/hardware/PiGpio/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-pi-gpio", - "version": "1.1.0", + "version": "1.1.1", "description": "The basic Node-RED node for Pi GPIO", "dependencies" : { },