其他分享
首页 > 其他分享> > 关闭树莓派的电源指示灯和状态指示灯

关闭树莓派的电源指示灯和状态指示灯

作者:互联网

在命令行输入一下指令:

echo 0 | sudo tee  /sys/class/leds/led0/brightness   //状态指示灯,范围 0-255
echo none | sudo tee  /sys/class/leds/led0/trigger
echo none | sudo tee  /sys/class/leds/led1/trigger
echo 0 | sudo tee /sys/class/leds/led1/brightness    //电源灯

 如果要每次开机生效, 可编辑/etc/rc.local文件

sudo vi /etc/rc.local 

增加上面四行

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

exit 0

echo 0 | tee  /sys/class/leds/led0/brightness
echo none | tee  /sys/class/leds/led0/trigger
echo none | tee  /sys/class/leds/led1/trigger
echo 0 | tee /sys/class/leds/led1/brightness

参考资料:

https://www.cnblogs.com/rootming/p/12245502.html

 

标签:指示灯,树莓,sudo,电源,echo,sys,leds,tee,class
来源: https://blog.csdn.net/qq_34638161/article/details/117674815