View unanswered posts | View active topics It is currently Thu Dec 12, 2019 3:54 am

Reply to topic  [ 2 posts ] 
Author Message

Joined: Mon Jan 15, 2018 9:13 am
Posts: 1

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?


Mon Jan 15, 2018 9:56 am
Site Admin

Joined: Mon Dec 25, 2017 4:21 pm
Posts: 386
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

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

Thu Jan 18, 2018 9:51 am
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.