fix gpio initial read timing and order

This commit is contained in:
Dave Conway-Jones 2020-05-09 16:51:22 +01:00
parent c79bcfbd0e
commit 05a9312905
No known key found for this signature in database
GPG Key ID: 302A6725C594817F
2 changed files with 3 additions and 2 deletions

View File

@ -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:

View File

@ -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" : {
},