|
发表于 2021-10-22 19:14:30
只看该作者
沙发
参考https://wiki.t-firefly.com/Core- ... io-yin-jiao-ji-suan,注意导出gpio是否被占用了。
假如157没被使用
- :/ # ls /sys/class/gpio/
- export gpiochip128 gpiochip32 gpiochip64 unexport
- gpiochip0 gpiochip255 gpiochip500 gpiochip96
- :/ # echo 157 > /sys/class/gpio/export
- :/ # ls /sys/class/gpio/
- export gpiochip0 gpiochip255 gpiochip500 gpiochip96
- gpio157 gpiochip128 gpiochip32 gpiochip64 unexport
- :/ # ls /sys/class/gpio/gpio157
- active_low device direction edge power subsystem uevent value
- :/ # cat /sys/class/gpio/gpio157/direction
- in
- :/ # cat /sys/class/gpio/gpio157/value
- 0
- echo out >/sys/class/gpio/gpio157/direction
- echo 1 >/sys/class/gpio/gpio157/value
复制代码 |
|