Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:vim3:applications:gpio:led

VIM3/3L LED

Introduction

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

VIM1/2/3/3L

We will take sys_led (white) as an example.

Turn off

Set the LED node parameter to none to turn off the LED:

$ 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:

$ 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:

$ echo heartbeat | sudo tee /sys/class/leds/sys_led/trigger

You can also experiment with other parameters.

VIM1S/VIM4

We will take pwmled (white) as an example.

Turn off

Set the LED node parameter to none to turn off the LED:

$ 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:

$ 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:

$ echo heartbeat | sudo tee /sys/class/leds/pwmled/trigger

You can also experiment with other parameters.

Edge1

We will use sys_led as an example:

Turn off

Set the LED node parameter to none to turn off the LED:

$ 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:

$ 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:

$ echo heartbeat | sudo tee /sys/class/leds/sys_led/trigger

You can also experiment with other parameters.

Edge2

We will use red_led as an example:

Turn off

Set the LED node parameter to none to turn off the LED:

$ 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:

$ 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:

$ echo heartbeat | sudo tee /sys/class/leds/red_led/trigger

The others are similar.

You can also experiment with other parameters.

2022/06/29 09:38 · 2 Comments
Last modified: 2022/09/19 04:49 by nick