GPIO fan and blue LED control
l3iggs edited this page Apr 30, 2015
·
11 revisions
Pages 12
- Home
- Building with Yocto
- Cross compiling toolchain setup
- Flashing u boot onto the tbs2910
- Generate a root file system (image)
- Get, patch and build the kernel
- Get, patch and build u boot
- GPIO fan and blue LED control
- Setting up cpu frequency scaling
- Setting up the internal eMMC
- Switching what you boot from
- WiFi
Clone this wiki locally
The board's schematic shows the following useful GPIO Pin number assignments
| GPIO Pin | Direction | Function |
|---|---|---|
| 2 | output | Blue LED |
| 4 | input | Volume up button |
| 5 | input | Volume down button |
| 92 | output | Fan |
I want the pointless blue LED off and the fan to be running. So I put the following code into /etc/rc.local
#fan on
echo 255 | sudo tee /sys/class/hwmon/hwmon0/pwm1
#light off
echo 0 | sudo tee /sys/class/leds/blue_status_led/brightness
#depending on how your kernel was compiled, the above might not work. Try this:
#PIN=2
#echo $PIN > /sys/class/gpio/export
#echo "out" > /sys/class/gpio/gpio${PIN}/direction
#echo 0 > /sys/class/gpio/gpio${PIN}/value