RPi

From SoftwareGuy
Revision as of 19:26, 19 March 2023 by Mark (talk | contribs) (Created page with "Setup as output echo "23" > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio23/direction echo "1" > /sys/class/gpio/gpio23/value echo "0" > /sys/class/gpio/gpio23/value Setup as input echo "23" > /sys/class/gpio/export echo "in" > /sys/class/gpio/gpio23/direction cat /sys/class/gpio/gpio23/value echo "23" > /sys/class/gpio/unexport Or: gpio -g mode 23 out...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Setup as output

echo "23" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio23/direction
echo "1" > /sys/class/gpio/gpio23/value
echo "0" > /sys/class/gpio/gpio23/value

Setup as input

echo "23" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio23/direction
cat /sys/class/gpio/gpio23/value
echo "23" > /sys/class/gpio/unexport

Or:

gpio -g mode 23 out
gpio -g write 23 1
gpio -g write 23 0