树莓派zero2w PWR LED设置为ACT LED (硬盘灯) Raspberry Pi zero2w PWR LED is set to ACT LED (hard drive light)

树莓派zero2w只有一个LED灯,充当两个功能,分别是电源PWR(常亮)和SD卡读写ACT

具体表现是,上电后LED会亮起来,SD卡有读写就闪烁.

根据官方的文档,说这个LED是反方向的LED,也就是说,SD卡活动的时候灯会灭掉,不活动的时候会常亮.

我个人非常不喜欢这种粘合效果,所以需要去掉电源常亮,只有SD卡活动的时候才亮起的效果,也就是和传统台式机硬盘指示灯一样的效果.

Raspberry Pi zero2w has only one LED , which serves as two functions, namely power supply PWR (constant light) and SD card activit(read or write) ACT

The LED will light up after power on, and the SD card will flash when it is read ro written.

According to the official document, this LED is the reverse direction LED,it means the light will light when the SD card is active, and it will always be turn off when it is not active.

I personally don't like this bonding effect very much, so I need to remove the power supply (PWR LED) and the effect that only turn on when the SD card is active, which is the same effect as the traditional desktop hard drive indicator.

Modify the configuration file /boot/config.txt and add the following sections of configuration

修改配置文件/boot/config.txt,增加下面几段配置

Modify the configuration file /boot/config.txt and add the following sections of configuration

# 触发源来自第一个sd卡的读写,The trigger source comes from the first SD card,
dtparam=act_led_trigger=mmc0
# 设置为常灭,zero2W IO口是属于灌电流,我们需要SD卡活动的时候拉低IO,让led亮,和pi4刚好相反,
# Set to always turn off, the zero 2 W IO port is a current sink, 
# we need to pull down IO when SD card is active
dtparam=act_led_activelow=on

然后重启生效.

测试用例,可以执行下面这段指令,写入填0文件到SD卡上,回车的同时一并观察LED是否同时亮起

Then restart to take effect.

For the test case, you can execute the following command, write the 0-filled file to the SD card, and press Enter and observe whether the LED is on at the same time

 dd if=/dev/zero of=/root/test.db bs=1024k count=100 conv=fdatasync oflag=direct

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值