~~tag>LED linux~~ ====== LED ====== ===== Introduction ===== /* This page mainly describes the onboard LEDs and leads you to control the LEDs. */ This page introduces the usage of Onboard LED indicators under Linux, and leads you to control the LEDs. ===== Device LED configurations ===== ^ Device ^ Node name ^ LED color ^ ^ VIM1/2 | /sys/class/leds/sys_led | White | ^ VIM3/3L | /sys/class/leds/red_led | Red | | ::: | /sys/class/leds/sys_led | | ^ VIM1S/VIM4 | /sys/class/leds/pwmled | | ^ Edge1 | /sys/class/leds/red_led | | | ::: | /sys/class/leds/sys_led | | ^ Edge2 | /sys/class/leds/red_led | Red | | ::: | /sys/class/leds/green_led | Green | | ::: | /sys/class/leds/blue_led | Blue | ===== Setup LED ===== We will take ''sys_led'' (white) as an example. **Turn off** Set the LED node parameter to ''none'' to turn off the LED: ```shell $ echo none | sudo tee /sys/class/leds/sys_led/trigger ``` **Turn on** Set the LED node parameter to ''default-on'' to keep the LED permanently on: ```shell $ echo default-on | sudo tee /sys/class/leds/sys_led/trigger ``` **Set LED heartbeat** Set the LED node parameter to ''heartbeat'', to make the LED flash with a heartbeat blink: ```shell $ echo heartbeat | sudo tee /sys/class/leds/sys_led/trigger ``` You can also experiment with other parameters. We will take ''pwmled'' (white) as an example. **Turn off** Set the LED node parameter to ''none'' to turn off the LED: ```shell $ echo none | sudo tee /sys/class/leds/pwmled/trigger ``` **Turn on** Set the LED node parameter to ''default-on'', to make the LED permanently on: ```shell $ echo default-on | sudo tee /sys/class/leds/pwmled/trigger ``` **Set LED heartbeat** Set the LED node parameter to ''heartbeat'', to make the LED flash with a heartbeat blink: ```shell $ echo heartbeat | sudo tee /sys/class/leds/pwmled/trigger ``` You can also experiment with other parameters. We will use ''sys_led'' as an example: **Turn off** Set the LED node parameter to ''none'' to turn off the LED: ```shell $ echo none | sudo tee /sys/class/leds/sys_led/trigger ``` **Turn on** Set the LED node parameter to ''default-on'' to keep the LED permanently on: ```shell $ echo default-on | sudo tee /sys/class/leds/sys_led/trigger ``` **Set LED heartbeat** Set the LED node parameter to ''heartbeat'', to make the LED flash with a heartbeat blink: ```shell $ echo heartbeat | sudo tee /sys/class/leds/sys_led/trigger ``` You can also experiment with other parameters. We will use ''red_led'' as an example: **Turn off** Set the LED node parameter to ''none'' to turn off the LED: ```shell $ echo none | sudo tee /sys/class/leds/red_led/trigger ``` **Turn on** Set the LED node parameter to ''default-on'' to keep the LED permanently on: ```shell $ echo default-on | sudo tee /sys/class/leds/red_led/trigger ``` **Set LED heartbeat** Set the LED node parameter to ''heartbeat'', to make the LED flash with a heartbeat blink: ```shell $ echo heartbeat | sudo tee /sys/class/leds/red_led/trigger ``` The others are similar. You can also experiment with other parameters.