我使用的lichee Pi 芯片是全志的v3s。摸索一下linux的点灯。
我的代码
#!/bin/sh echo "led run!" echo 36 > /sys/class/gpio/unexport echo 37 > /sys/class/gpio/unexport echo 36 > /sys/class/gpio/export echo 37 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio36/direction echo out > /sys/class/gpio/gpio37/direction for i in `seq 10` do echo 1 > /sys/class/gpio/gpio36/value echo 0 > /sys/class/gpio/gpio37/value sleep 1s echo 0 > /sys/class/gpio/gpio36/value echo 1 > /sys/class/gpio/gpio37/value sleep 1s done echo 36 > /sys/class/gpio/unexport echo 37 > /sys/class/gpio/unexport
这个36 37的意思是这样,我用的io口是PB4 PB5,根据规则: