本帖最后由 makeWorks 于 2017-9-17 22:09 编辑
首先安装WiringNP library,在shell下运行下面命令
git clone https://github.com/friendlyarm/WiringNP
cd WiringNP/
chmod 755 build
./build
验证WiringNP是否安装成功
gpio readall
如果安装成功,将会显示下面信息
shell下控制gpio66的方向
gpio mode 66 out
点亮led灯
gpio write 66 0
熄灭led灯
gpio write 66 1
以上命令,可以通过sh脚本演示
LED=66
gpio mode $LED out
while true; do
gpio write $LED 1
sleep 0.5
gpio write $LED 0
sleep 0.5
done
本帖最后由 makeWorks 于 2017-9-17 22:09 编辑
首先安装WiringNP library,在shell下运行下面命令
git clone https://github.com/friendlyarm/WiringNP
cd WiringNP/
chmod 755 build
./build
验证WiringNP是否安装成功
gpio readall
如果安装成功,将会显示下面信息
shell下控制gpio66的方向
gpio mode 66 out
点亮led灯
gpio write 66 0
熄灭led灯
gpio write 66 1
以上命令,可以通过sh脚本演示
LED=66
gpio mode $LED out
while true; do
gpio write $LED 1
sleep 0.5
gpio write $LED 0
sleep 0.5
done