Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9868 Discussions

How can I control the onboard LED through sysfs?

en
Novice
1,801 Views

Hi, I used the "Galileo IO Mappings" document to control pin 13, when I set this pin HIGH it doesn't light the onboard LED.

In the 'blink' sketch, setting pin 13 high does make the onboard LED light. But not with sysfs. What is the reason for this?

and how can I control the onboard LED with sysfs?

0 Kudos
1 Solution
Erik_N_Intel
Employee
166 Views

arduino_lover,

the onboard LED is not actually connected to pin 13. The board is set up so that when you call to pin 13 in an Arduino sketch, then this controls the onboard LED too (this was done so that the Blink sketch would work out of the box.)

If you want to control this LED through sysfs, then you need to write to gpio3. no muxes need to be set for this.

echo 3 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio3/direction

echo 1 > /sys/class/gpio/gpio3/value

 

Erik. 

View solution in original post

2 Replies
Erik_N_Intel
Employee
167 Views

arduino_lover,

the onboard LED is not actually connected to pin 13. The board is set up so that when you call to pin 13 in an Arduino sketch, then this controls the onboard LED too (this was done so that the Blink sketch would work out of the box.)

If you want to control this LED through sysfs, then you need to write to gpio3. no muxes need to be set for this.

echo 3 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio3/direction

echo 1 > /sys/class/gpio/gpio3/value

 

Erik. 

View solution in original post

RWald1
Innovator
166 Views

arduino_4_life do you know where in the source code for the Arduino IDE (the version for Galileo) this alternate path is taken? I've been through all of the x86/cores/arduino code as I'm trying to figure out how a call to digitalWrite(13, HIGH|LOW) would be disambiguated.

Reply