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

Onboard LED indicators usage under Linux . You will learn how to control the LEDs.

Device LED configurations

Device Device Node LED color
VIM1/2 /sys/class/leds/sys_led White
VIM3/3L /sys/class/leds/red_led Red
/sys/class/leds/sys_led
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.

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/07/13 02:17 by hyphop