Difference between revisions of "Rockpi4/hardware/led"
(create page for LED) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{rockpi4_header}} | ||
+ | {{Languages|rockpi4/hardware/led}} | ||
+ | |||
+ | [[rockpi4 | ROCK Pi 4]] > [[rockpi4/hardware | Hardware]] > [[rockpi4/hardware/led | LED]] | ||
+ | |||
+ | === Light-emitting diodes (LED) === | ||
+ | |||
There are 2 LEDs on the Rock Pi 4. | There are 2 LEDs on the Rock Pi 4. | ||
Line 4: | Line 11: | ||
It is '''''green''''' in color and used to indicate power supply. | It is '''''green''''' in color and used to indicate power supply. | ||
+ | |||
+ | ==== ROCK Pi 4C+ ==== | ||
+ | |||
+ | # echo 124 > /sys/class/gpio/export | ||
+ | # echo out > /sys/class/gpio/gpio124/direction | ||
+ | # echo 1 > /sys/class/gpio/gpio124/value # Turn LED off | ||
+ | # echo 0 > /sys/class/gpio/gpio124/value # Turn LED on | ||
=== Status === | === Status === | ||
Line 19: | Line 33: | ||
# echo mmc1 > /sys/class/leds/user-led2/trigger | # echo mmc1 > /sys/class/leds/user-led2/trigger | ||
+ | |||
+ | To turn LED on: | ||
+ | |||
+ | # echo default-on > /sys/class/leds/user-led2/trigger | ||
+ | |||
+ | To turn LED off: | ||
+ | |||
+ | # echo none > /sys/class/leds/user-led2/trigger |
Latest revision as of 11:18, 6 June 2022
ROCK Pi 4 > Hardware > LED
Light-emitting diodes (LED)
There are 2 LEDs on the Rock Pi 4.
Power
It is green in color and used to indicate power supply.
ROCK Pi 4C+
# echo 124 > /sys/class/gpio/export # echo out > /sys/class/gpio/gpio124/direction # echo 1 > /sys/class/gpio/gpio124/value # Turn LED off # echo 0 > /sys/class/gpio/gpio124/value # Turn LED on
Status
It is red for Rock Pi 4 v1.3 and blue for Rock Pi 4 v1.4. Shows the status of the device.
For newer kernel, the status LED is configured as heart beat device and usually blinks on/after booting successfully.
Its function can be changed as desired.
$ cat /sys/class/leds/user-led2/trigger none rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock mmc0 mmc1 timer oneshot [heartbeat] backlight gpio cpu0 cpu1 cpu2 cpu3 cpu4 cpu5 default-on rfkill0 mmc2 rfkill1 rfkill2
For example, to set it to show emmc read/write status:
# echo mmc1 > /sys/class/leds/user-led2/trigger
To turn LED on:
# echo default-on > /sys/class/leds/user-led2/trigger
To turn LED off:
# echo none > /sys/class/leds/user-led2/trigger