mirror of
				https://github.com/node-red/node-red-nodes.git
				synced 2025-03-01 10:37:43 +00:00 
			
		
		
		
	fix gpio initial read timing and order
This commit is contained in:
		| @@ -118,11 +118,12 @@ if len(sys.argv) > 2: | |||||||
|         else: |         else: | ||||||
|             GPIO.setup(pin,GPIO.IN) |             GPIO.setup(pin,GPIO.IN) | ||||||
|  |  | ||||||
|         print(GPIO.input(pin)) |  | ||||||
|         if bounce > 0: |         if bounce > 0: | ||||||
|             GPIO.add_event_detect(pin, GPIO.BOTH, callback=handle_callback, bouncetime=int(bounce)) |             GPIO.add_event_detect(pin, GPIO.BOTH, callback=handle_callback, bouncetime=int(bounce)) | ||||||
|         else : |         else : | ||||||
|             GPIO.add_event_detect(pin, GPIO.BOTH, callback=handle_callback) |             GPIO.add_event_detect(pin, GPIO.BOTH, callback=handle_callback) | ||||||
|  |         sleep(0.1) | ||||||
|  |         print(GPIO.input(pin)) | ||||||
|  |  | ||||||
|         while True: |         while True: | ||||||
|             try: |             try: | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "name": "node-red-node-pi-gpio", |   "name": "node-red-node-pi-gpio", | ||||||
|   "version": "1.1.0", |   "version": "1.1.1", | ||||||
|   "description": "The basic Node-RED node for Pi GPIO", |   "description": "The basic Node-RED node for Pi GPIO", | ||||||
|   "dependencies"  : { |   "dependencies"  : { | ||||||
|   }, |   }, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user