New answers tagged

0

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


-1

According to https://gist.github.com/aitzol/1b1642712146adf5bcd8 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: ...


1

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