Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:common:applications:gpio:led

This is an old revision of the document!


LED

Introduction

This page mainly introduces the usage of Onboard LED indicators under Linux. You will learn how 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

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 > /sys/class/leds/sys_led/trigger

You can also try 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 > /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 > /sys/class/leds/sys_led/trigger

You can also experiment with other parameters.

Edge2

Last modified: 2022/08/07 21:07 by olivia