This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
products:sbc:common:applications:gpio:led [2022/07/04 02:53] frank old revision restored (2022/07/04 14:41) |
products:sbc:common:applications:gpio:led [2023/08/16 06:37] jacobe [Edge2] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ~~tag> | ||
====== 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 |
+ | ^ VIM1/ | ||
+ | ^ VIM3/ | ||
+ | | ::: | ||
+ | ^ VIM1S/ | ||
+ | ^ Edge1 | ||
+ | | ::: | ||
+ | ^ Edge2 | ||
+ | | ::: | ||
+ | | ::: | ||
- | <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 '' |
- | VIM3/VIM3L has two nodes. | + | **Turn off** |
- | <code bash> | + | Set the LED node parameter to '' |
- | ls / | + | |
- | red_led | + | |
- | </ | + | |
- | <tabbox VIM4> | + | ```shell |
+ | $ echo none | sudo tee / | ||
+ | ``` | ||
- | VIM4 has only one node pwmled. | + | **Turn on** |
- | <code bash> | + | Set the LED node parameter to '' |
- | $ ls / | + | |
- | pwmled | + | |
- | </ | + | |
- | <tabbox Edge2> | + | ```shell |
+ | $ echo default-on | sudo tee / | ||
+ | ``` | ||
- | </ | + | **Set LED heartbeat** |
- | ===== Setup LED ===== | + | Set the LED node parameter to '' |
- | <tabbox VIM1/2/3/3L> | + | ```shell |
+ | $ echo heartbeat | sudo tee /sys/class/leds/ | ||
+ | ``` | ||
- | We will use sys_led (white) as an example. | + | You can also experiment with other parameters. |
- | * Turn off | + | <tabbox VIM1S/ |
- | Set the LED node parameter to none to turn off the LED: | + | We will take '' |
- | <code bash> | + | **Turn off** |
- | $ echo none | sudo tee / | + | |
- | </ | + | |
- | * Turn on | + | Set the LED node parameter to '' |
- | Set the LED node parameter to default-on to keep the LED permanently on: | + | ```shell |
+ | $ echo none | sudo tee / | ||
+ | ``` | ||
- | <code bash> | + | **Turn |
- | $ echo default-on | sudo tee / | + | |
- | </ | + | |
- | * Set LED heartbeat | + | Set the LED node parameter to '' |
- | Set the LED node parameter to heartbeat, to make the LED flash with a heartbeat blink: | + | ```shell |
+ | $ echo default-on | sudo tee / | ||
+ | ``` | ||
- | <code bash> | ||
- | $ echo heartbeat > / | ||
- | </ | ||
- | You can also experiment with other parameters. | + | **Set LED heartbeat** |
- | <tabbox VIM4> | + | Set the LED node parameter to '' |
- | Lets use pwmled | + | ```shell |
+ | $ echo heartbeat | sudo tee / | ||
+ | ``` | ||
- | * 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 / | + | |
- | </ | + | |
- | | + | **Turn off** |
- | Set the LED node parameter to heartbeat, | + | Set the LED node parameter to '' |
- | <code bash> | + | ```shell |
- | $ echo heartbeat | + | $ echo none | sudo tee / |
- | </ | + | ``` |
+ | **Turn on** | ||
- | * Set LED heartbeat | + | Set the LED node parameter to '' |
- | Set the LED node parameter to heartbeat, to make the LED flash with a heartbeat blink: | + | ```shell |
+ | $ echo default-on | sudo tee / | ||
+ | ``` | ||
+ | **Set LED heartbeat** | ||
- | <code bash> | + | Set the LED node parameter to '' |
- | $ echo heartbeat | + | |
- | </ | + | ```shell |
+ | $ echo heartbeat | ||
+ | ``` | ||
You can also experiment with other parameters. | You can also experiment with other parameters. | ||
<tabbox Edge2> | <tabbox Edge2> | ||
+ | We will use red_led blue_led green_led | ||
+ | |||
+ | **Turn off** | ||
+ | |||
+ | Set the LED node parameter to '' | ||
+ | |||
+ | ```shell | ||
+ | $ echo none | sudo tee / | ||
+ | ``` | ||
+ | |||
+ | **Turn on** | ||
+ | |||
+ | Set the LED node parameter to '' | ||
+ | |||
+ | ```shell | ||
+ | $ echo default-on | sudo tee / | ||
+ | ``` | ||
+ | **Set LED heartbeat** | ||
+ | |||
+ | Set the LED node parameter to '' | ||
+ | |||
+ | ```shell | ||
+ | $ echo heartbeat | sudo tee / | ||
+ | ``` | ||
+ | The others are similar. | ||
+ | |||
+ | You can also experiment with other parameters. | ||
</ | </ |