|
发表于 2020-4-6 08:22:34
|
显示全部楼层
Junix 发表于 2020-4-6 08:10
root@localhost:/sys/class/gpio# echo 460 > export
root@localhost:/sys/class/gpio# cd gpio460
roo ...
写了个脚本试了下,GPIO4 GPIO5 GPIO6可以正常输出高低,GPIO3只输出高。
root@LEDE:~# cat gpio-test.sh
#!/bin/sh
echo 460 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio460/direction
echo 461 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio461/direction
echo 462 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio462/direction
echo 463 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio463/direction
while true
do
echo 0 > /sys/class/gpio/gpio460/value
echo 0 > /sys/class/gpio/gpio461/value
echo 0 > /sys/class/gpio/gpio462/value
echo 0 > /sys/class/gpio/gpio463/value
echo output-low
sleep 1
echo 1 > /sys/class/gpio/gpio460/value
echo 1 > /sys/class/gpio/gpio461/value
echo 1 > /sys/class/gpio/gpio462/value
echo 1 > /sys/class/gpio/gpio463/value
echo output-high
sleep 1
done
|
|