Hello,
I need to control the 2 GPIO LEDS in Linux.
Is necessary a specific driver to control them or I can simply control the GPIOs from "/sys/class/gpio"? If so which GPIOs are connected to the LEDS?
Regards
GPIO LEDS
Moderator: Andrey.Mazlin
Re: GPIO LEDS
In Linux kernel GPIOs related to the north part of the SOC numbered from 434:
GPIO_1 = 435
GPIO_2 = 436
GPIO_3 = 437
GPIO_4 = 438
You’ll Need to work as root (root password required):
$ su
Password:
To control gpio435 (GPIO_1, DS3 green LED on fitlet2):
$ echo 435 > /sys/class/gpio/export
$ echo out > /sys/class/gpio/gpio435/direction
$ echo 1 > /sys/class/gpio/gpio435/value
# DS3 green LED should be GREEN now
$ echo 0 > /sys/class/gpio/gpio435/value
# DS3 green LED 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
GPIO_1 = 435
GPIO_2 = 436
GPIO_3 = 437
GPIO_4 = 438
You’ll Need to work as root (root password required):
$ su
Password:
To control gpio435 (GPIO_1, DS3 green LED on fitlet2):
$ echo 435 > /sys/class/gpio/export
$ echo out > /sys/class/gpio/gpio435/direction
$ echo 1 > /sys/class/gpio/gpio435/value
# DS3 green LED should be GREEN now
$ echo 0 > /sys/class/gpio/gpio435/value
# DS3 green LED 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