Hardware Reference
In-Depth Information
Solution
On Linux, everything is a file ; that is, you can access all the inputs and outputs, the LEDs,
and so on by opening the right file and reading or writing to it. For example, try the follow-
ing:
bone# cd /sys/class/leds/
bone# ls
beaglebone:green:usr0 beaglebone:green:usr2
beaglebone:green:usr1 beaglebone:green:usr3
What you are seeing are four directories, one for each onboard LED. Now try this:
bone# cd beaglebone\:green\:usr0
bone# ls
brightness device max_brightness power subsystem trigger uevent
bone# cat trigger
none nand-disk mmc0 mmc1 timer oneshot [heartbeat]
backlight gpio cpu0 default-on transient
The first command changes into the directory for LED usr0 , which is the LED closest to
the edge of the board. The [heartbeat] indicates that the default trigger (behavior) for
the LED is to blink in the heartbeat pattern. Look at your LED. Is it blinking in a heartbeat
pattern?
Then try the following:
bone# echo none > trigger
bone# cat trigger
[none] nand-disk mmc0 mmc1 timer oneshot heartbeat
backlight gpio cpu0 default-on transient
This instructs the LED to use none for a trigger. Look again. It should be no longer blink-
ing.
Now, try turning it on and off:
bone# echo 1 > brightness
bone# echo 0 > brightness
Search WWH ::




Custom Search