New answers tagged


A solution could be to set up the same callback for each pin of interest: for channel in channels_of_interest: # add rising edge detection on a channel GPIO.add_event_detect(channel, GPIO.RISING, callback=cb) The callback, which I denoted cb, has a single argument that represents the channel being triggered: def cb(channel): if channel == 18: ...


According to we can use this simple code: #!/usr/bin/env python import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) while True: data = input("Insert GPIO BCN number to check status (blank to quit): ") if (data == ''): break try: number = int(data) except: ...


I have no reason to doubt that your tests are correct for the RPi.GPIO Python module. If you need to have more events queued you could use the pigpio Python module. It will queue up hundreds of events. pigpio callbacks

Top 50 recent answers are included