I'm building a prototype lift shaft, as many of you may know. And I was wondering what the best GPIO callback is, and how to use it. I've tried RPIO, bu I couldn't download it. And I've heard of 'edge' but I have no clue on how to use it.


A GPIO callback is a method of being notified when a GPIO changes level.

The level change may be low to high (rising edge) or high to low (falling edge). You can ask to be notified on rising edges, falling edges, or both.

So say a lift arriving at floor 3 changes the state of a GPIO from 1 to 0 you could ask to be notified about falling edges for that GPIO. Your callback code would do what needs to be done for that event.

You don't say specifically but the mention of RPIO and the tag of RPi.GPIO suggests you are going to use Python.

See http://elinux.org/RPi_GPIO_Code_Samples#Python for RPi Python modules which support GPIO.

That link has additional links to the documentation for those Python modules. I suggest you look through and decide which to try.

RPi.GPIO is pre-installed in recent raspberrypi.org Raspbian images, the others would need to be downloaded.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.