I am struggling with this and am hoping someone can tell me how to make it work. I am trying to set up three buttons on the Jetson Nano and to respond to the GPIO.event_detect GPIO.FALLING event.
I have attached my circuit diagram. I have tried many pins - both those labelled High and Low on GPIO button seems to latch, maybe wrong resistor value but unsure of cause - Jetson Nano - NVIDIA Developer Forums (including 12,16,18,21,24,26,28,31).
The buttons work for a while but then stop. My code does not break so I can’t figure out how to debug it - it just doesn’t respond to the buttons. All tests with a multimeter suggest that the circuit works. I have tried pullup resistors of 4.7k, 1k and 100 ohm but get very similar results.
I am a novice on the hardware side of things and just don’t know what to do next in order to troubleshoot. This seemed like a very achievable project - so if someone can help, it would be very kind.
Thanks.
Code:
import RPi.GPIO as GPIO
but_pin1=18
but_pin2=31
but_pin3=21
def button1(channel):
print(‘button1’)
#- etc
def button2(channel):
print(‘button2’)
#- etc
def button3(channel):
print(‘button3’)
#- etc
GPIO.setmode(GPIO.BOARD)
GPIO.setup(but_pin1, GPIO.IN)
GPIO.setup(but_pin2, GPIO.IN)
GPIO.setup(but_pin3, GPIO.IN)
GPIO.add_event_detect(but_pin1, GPIO.FALLING, callback=button1, bouncetime=10)
GPIO.add_event_detect(but_pin2, GPIO.FALLING, callback=button2, bouncetime=10)
GPIO.add_event_detect(but_pin3, GPIO.FALLING, callback=button3, bouncetime=10)
message=input(“Press enter to stop”)
GPIO.cleanup()