With Raspberry Pi, if you have
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP) def my_callback(channel): print "falling edge detected on ", channel GPIO.add_event_detect(17, GPIO.FALLING, callback=my_callback, bouncetime=300) GPIO.add_event_detect(20, GPIO.FALLING, callback=my_callback, bouncetime=300)
you get the usual callback called when pin 17 falls or when pin 20 falls The callback function prints which channel was called.
My question is, what happens if both pins falls at the same time?
Unfortunately I don't have a Pi to try it right now and even if I did, the human error in -say- pressing one pin attached button before another also counts. What happens when it is done at the exact same time?