Cubieboard/Programming/StatusLEDs

From linux-sunxi.org
Jump to navigation Jump to search

Accessing the status LEDs

The Cubieboard has two status LEDs, a green one and a blue one. These can be accessed and switched on and off with the following instructions.

Preparation

You need to have a bootable image with a recent kernel (3.x).

Add the following lines to your script.bin

[leds_para]
leds_used = 1
leds_num = 2
leds_pin_1 = port:PH20<1><default><default><0>
leds_name_1 = "green:ph20:led1"
leds_pin_2 = port:PH21<1><default><default><0>
leds_name_2 = "blue:ph21:led2"

Access

Enable an LED (blue, in this case):

echo 255 > /sys/class/leds/blue\:ph21\:led2/brightness

Switch off an LED (blue, in this case):

echo 0 > /sys/class/leds/blue\:ph21\:led2/brightness

Blinking an LED (blue, in this case):

echo timer > /sys/class/leds/blue\:ph21\:led2/trigger


Use an LED (blue, in this case) to show SD card activity

echo mmc0 > /sys/class/leds/blue\:ph21\:led2/trigger

For others available triggers, run the command

cat /sys/class/leds/blue\:ph21\:led2/trigger