Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:common:applications:gpio:led

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:common:applications:gpio:led [2022/07/04 02:53]
frank [LED Nodes] add Edge1 node
products:sbc:common:applications:gpio:led [2023/11/07 03:23] (current)
nick
Line 1: Line 1:
 +~~tag>LED linux~~
 ====== LED ====== ====== 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 =====
  
-===== LED Nodes =====+^  Device      ^  Node name                  ^  LED color  ^ 
 +^  VIM1/     |  /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       |
  
-<tabbox VIM1/2> 
  
-VIM1/VIM2 has only one node.+===== Setup LED =====
  
-<code bash> +<tabbox VIM1/2/3/3L>
-$ ls /sys/class/leds +
-sys_led +
-</code>+
  
-<tabbox VIM3/3L>+We will take ''sys_led'' (white) as an example.
  
-VIM3/VIM3L has two nodes.+**Turn off**
  
-<code bash> +Set the LED node parameter to ''none'' to turn off the LED:
-ls /sys/class/leds +
-red_led  sys_led +
-</code>+
  
-<tabbox VIM4>+```shell 
 +$ echo none | sudo tee /sys/class/leds/sys_led/trigger 
 +```
  
-VIM4 has only one node pwmled.+**Turn on**
  
-<code bash> +Set the LED node parameter to ''default-on'' to keep the LED permanently on: 
-$ ls /sys/class/leds + 
-pwmled +```shell 
-</code> +echo default-on | sudo tee /sys/class/leds/sys_led/trigger
-<tabbox Edge1> +
-```sh +
-ls /sys/class/leds +
-read_led  sys_led+
 ``` ```
-<tabbox Edge2> 
  
-</tabbox>+**Set LED heartbeat**
  
-===== Setup LED =====+Set the LED node parameter to ''heartbeat'', to make the LED flash with a heartbeat blink:
  
-<tabbox VIM1/2/3/3L>+```shell 
 +$ echo heartbeat | sudo tee /sys/class/leds/sys_led/trigger 
 +```
  
-We will use sys_led (white) as an example.+You can also experiment with other parameters.
  
-  * Turn off+<tabbox VIM1S/VIM4>
  
-Set the LED node parameter to none to turn off the LED:+We will take ''pwmled'' (white) as an example.
  
-<code bash> +**Turn off**
-$ echo none | sudo tee /sys/class/leds/sys_led/trigger +
-</code>+
  
-  * Turn on+Set the LED node parameter to ''none'' to turn off the LED:
  
-Set the LED node parameter to default-on to keep the LED permanently on:+```shell 
 +$ echo none | sudo tee /sys/class/leds/pwmled/trigger 
 +```
  
-<code bash> +**Turn on**
-$ echo default-on | sudo tee /sys/class/leds/sys_led/trigger +
-</code>+
  
-  * Set LED heartbeat+Set the LED node parameter to ''default-on'', to make the LED permanently on:
  
-Set the LED node parameter to heartbeat, to make the LED flash with a heartbeat blink:+```shell 
 +$ echo default-on | sudo tee /sys/class/leds/pwmled/trigger 
 +```
  
-<code bash> 
-$ echo heartbeat > /sys/class/leds/sys_led/trigger 
-</code> 
  
-You can also experiment with other parameters.+**Set LED heartbeat**
  
-<tabbox VIM4>+Set the LED node parameter to ''heartbeat'', to make the LED flash with a heartbeat blink:
  
-Lets use pwmled (white) as an example.+```shell 
 +$ echo heartbeat | sudo tee /sys/class/leds/pwmled/trigger 
 +```
  
-  * Turn off+You can also experiment with other parameters.
  
-Set the LED node parameter to none to turn off the LED:+<tabbox Edge1>
  
-<code bash> +We will use ''sys_led'' as an example:
-$ echo none | sudo tee /sys/class/leds/pwmled/trigger +
-</code>+
  
-  * Turn on+**Turn off**
  
-Set the LED node parameter to heartbeat, to make the LED flash with a heartbeat rhythm:+Set the LED node parameter to ''none'' to turn off the LED:
  
-<code bash> +```shell 
-$ echo heartbeat | sudo tee /sys/class/leds/pwmled/trigger +$ echo none | sudo tee /sys/class/leds/sys_led/trigger 
-</code>+```
  
 +**Turn on**
  
-  * Set LED heartbeat+Set the LED node parameter to ''default-on'' to keep the LED permanently on:
  
-Set the LED node parameter to heartbeat, to make the LED flash with a heartbeat blink:+```shell 
 +$ echo default-on | sudo tee /sys/class/leds/sys_led/trigger 
 +``` 
 +**Set LED heartbeat**
  
-<code bash> +Set the LED node parameter to ''heartbeat'', to make the LED flash with a heartbeat blink: 
-$ echo heartbeat /sys/class/leds/pwmled/trigger + 
-</code>+```shell 
 +$ echo heartbeat | sudo tee /sys/class/leds/sys_led/trigger 
 +```
  
 You can also experiment with other parameters. You can also experiment with other parameters.
  
 <tabbox Edge2> <tabbox Edge2>
 +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.
  
 </tabbox> </tabbox>
Last modified: 2022/07/04 02:53 by frank