已经放弃从新搞内核的想法。。。
来个shell点灯:
用到的io:
先切换到gpio目录下
cd /sys/class/gpio/
echo 11 > export
cd gpio11
echo out > direction
echo 1 >value
具体演示如下图:
效果图:
灭灯
echo 0 > value
来个脚本
#!/bin/sh
echo "Hello,led"
if [ -d /sys/class/gpio/gpio11 ];then
echo "gpio11 is created!"
else
echo 11 > /sys/class/gpio/export;
fi
echo out > /sys/class/gpio/gpio11/direction
while echo "hello"
do
echo 1 > /sys/class/gpio/gpio11/value
sleep 0.25
echo 0 > /sys/class/gpio/gpio11/value
sleep 0.25
done
echo 0 > /sys/class/gpio/gpio11/value