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 document mainly describes the onboard LEDs. You will learn how to control the LEDs.

LED Nodes

VIM1/2

VIM1/VIM2 has only one node.

$ ls /sys/class/leds
sys_led

VIM3/3L

VIM3/VIM3L has two nodes.

ls /sys/class/leds
red_led  sys_led

VIM4

VIM4 has only one node which is a PWM LED.

$ ls /sys/class/leds
pwmled

Edge1

Edge1 has two nodes.

$ ls /sys/class/leds
read_led  sys_led

Edge2

Setup LED

VIM1/2/3/3L

We will use 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

Lets use 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 heartbeat, to make the LED flash with a heartbeat rhythm:

$ echo heartbeat | 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/12 04:59 by nick