I know it's possible to write and read GPIO values using the command line:
echo 1 > /sys/class/gpio/gpio0/value
for example, puts the GPIO 0 pin on high.
Now, for reading, you use cat
. However, this restricts me to polling and does not prevent me from missing a state inbetween poll events.
Is there a way for me to register some kind of listener via the command line as you would with RPIO in Python?
I want to listen for value changes without polling. I assume polling extremely quickly (to make missing a state less likely) is not very healthy either?
There is a target called /sys/class/gpio/gpio../uevent
but I don't know what it is for.