Last active
September 16, 2020 18:59
-
-
Save a2gs/2f79fc9e68861d81f8ae9b1c25cb27e5 to your computer and use it in GitHub Desktop.
Raspberry Pi GPIO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Exporting a PIN (example, 9): | |
echo "9" > /sys/class/gpio/export | |
(/sys/class/gpio/unexport to undo) | |
2) Setting PIN direction | |
echo "out" > /sys/class/gpio/gpio9/direction | |
3) Changing/reading PIN value: | |
echo "1" > /sys/class/gpio/gpio9/value | |
https://www.kernel.org/doc/Documentation/gpio/sysfs.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
New GPIO Interface (Linux 5.5): gpiod
Manual: https://github.com/brgl/libgpiod
(for D language): https://libgpiod-dlang.dpldocs.info/gpiod.html
Samples: https://youtu.be/3pc5q9B8Ilo https://microhobby.com.br/blog/2020/02/02/new-linux-kernel-5-5-new-interfaces-in-gpiolib/