I have a button object that when pressed needs to perform something, and for this I'd need to get a property of the button. I'd like it to work like:
...
GPIO.add_event_detect(button, GPIO.RISING, callback=button_callback(button)) #I believe I can't add a parameter to button_callback like this
...
and then
def button_callback(button):
do_something(button.id)
Is this possible? How can I access the button object from within the callback?