GPIO fan and blue LED control

l3iggs edited this page Apr 30, 2015 · 11 revisions

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