GPIO - ON/OFF using Config.txt
Greetings,
I am trying to switch ON a GPIO using Config.txt
(A LED will be connected to the GPIO pin so that it will switch ON when the OS boots up and switches OFF when the OS is shutdown )
Can someone tell me the correct syntax for doing it ?
Thanks in advance.
Velind.
0
Comments
Using a shell script you can do this:
Naturally, you can dot his for any GPIOx pin. For inputs, set the direction to "in".
Thanks for the quick response.
For using GPIO 23, is the below syntax correct ?
echo 1 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio23/direction
chmod 666 /sys/class/gpio/gpio23/value
echo 1 > /sys/class/gpio/gpio23/value
Almost. The first line should be echo 23 > ... . To clarify, the last line sets the pin to high, to revert that echo 0 to it.