您的位置:首页 > 其它

点亮led【转载】

2013-11-29 09:54 106 查看
http://linux-sunxi.org/Cubieboard/Programming/StatusLEDs

AccessingthestatusLEDs

TheCubieboardhastwostatusLEDs,agreenoneandablueone.Thesecanbeaccessedandswitchedonandoffwiththefollowinginstructions.

Preparation

Youneedtohaveabootableimagewitharecentkernel(3.x).

Addthefollowinglinestoyourscript.bin

Access

EnableanLED(blue,inthiscase):

echo255>/sys/class/leds/blue\:ph21\:led2/brightness

[/code]
SwitchoffanLED(blue,inthiscase):

echo0>/sys/class/leds/blue\:ph21\:led2/brightness

[/code]
BlinkinganLED(blue,inthiscase):

echotimer>/sys/class/leds/blue\:ph21\:led2/trigger

[/code]

UseanLED(blue,inthiscase)toshowSDcardactivity

echommc0>/sys/class/leds/blue\:ph21\:led2/trigger

[/code]
Forothersavailabletriggers,runthecommand

cat/sys/class/leds/blue\:ph21\:led2/trigger

实际使用:

echo0>/sys/devices/platform/leds-sunxi/leds/blue:ph21:led2/brightness
echo255>/sys/devices/platform/leds-sunxi/leds/blue:ph21:led2/brightness

确定是那个盒子。


                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: