Today when I started learning how to use the JavaScript "onoff" library and then ran into some problems with them, specifically.
First of all, I cannot use the names of the existing GPIOs and the names in the wPi, I can only use the BCM.
When I use the pins declared in BCM to blink the led, it works great. But when I use some other pins as buttons I get the error:
gpio: Warning: File not present: /sys/class/gpio/gpio110/edge
and it's clear that the edge folder isn't actually there. When I use:
echo "1" > /sys/class/gpio/gpio110/value
for the pins that don't have an edge file, I get the error:
-bash: echo: write error: Operation not permitted
Trying to use echo "1" > /sys/class/gpio/gpio110/value
I tried manually copying the edge files from the existing files of other GPIO but that doesn't seem to be possible. Does anyone know how to fix it or can give me more information about them?
Finally, I got to use GPIO pins with out edge. It was a mistake when I tried to read its rising and falling edges. Just declare GPIO and use:
Here is my simple code:
and in the npm onoff I found this here
npm onoff image