Difference between revisions of "FAQ:fitlet2"
From fit-PC wiki
(Created page with "==General== ==Hardware== ===How to Control fitlet2 front LEDs?=== fitlet2 has 2 LEDs, LED1 and LED2. Each of them has GREEN and YELLOW parts that can be controlled separate...") (change visibility) |
(→How to Control fitlet2 front LEDs?) (change visibility) |
||
Line 14: | Line 14: | ||
To control the GPIOs need to login as root (root password required): | To control the GPIOs need to login as root (root password required): | ||
− | $ su | + | $ su |
− | Password: | + | Password: |
To control for example LED1 GREEN part: | To control for example LED1 GREEN part: | ||
− | + | $ echo 435 > /sys/class/gpio/export | |
− | + | $ echo out > /sys/class/gpio/gpio435/direction | |
− | + | $ echo 1 > /sys/class/gpio/gpio435/value | |
− | + | # LED1 should be GREEN now | |
− | + | $ echo 0 > /sys/class/gpio/gpio435/value | |
− | + | # LED1 should be OFF now | |
− | + | $ echo 435 > /sys/class/gpio/unexport | |
The GPIO framework and GPIO sysfs interface are documented in | The GPIO framework and GPIO sysfs interface are documented in |
Revision as of 09:07, 13 March 2018
General
Hardware
How to Control fitlet2 front LEDs?
fitlet2 has 2 LEDs, LED1 and LED2. Each of them has GREEN and YELLOW parts that can be controlled separately.
In Linux kernel there are 4 related GPIOs: GPIO435, GPIO436, GPIO437, GPIO438.
- GPIO435 - LED1 GREEN
- GPIO436 - LED1 YELLOW
- GPIO437 - LED2 GREEN
- GPIO438 - LED2 YELLOW
To control the GPIOs need to login as root (root password required):
$ su Password:
To control for example LED1 GREEN part:
$ echo 435 > /sys/class/gpio/export $ echo out > /sys/class/gpio/gpio435/direction $ echo 1 > /sys/class/gpio/gpio435/value # LED1 should be GREEN now $ echo 0 > /sys/class/gpio/gpio435/value # LED1 should be OFF now $ echo 435 > /sys/class/gpio/unexport
The GPIO framework and GPIO sysfs interface are documented in https://www.kernel.org/doc/Documentation/gpio/gpio.txt