Can libmraa be used to control the User LEDs?

Using the led-gpio-demo.cpp code example.
Trying to access the User LEDs 1-4 near the USB connectors, but all the values I can find for those pins passed to mraa:Gpio(val) give the ‘invalid GPIO pin’ runtime error.
When I use the low speed connector pin references, like 27 for GPIO_E, it’s ok.

On DB410C the user LEDs are controlled by the Linux LED sub-system (I
think if you try to access them as GPIO they will appear to be busy).

Unfortunately it doesn’t look to me like MRAA has any support for the
LED sub-system.

Anyhow, you can do something like this (or the equivalent in C) to
control the LEDs:

 echo 1 | \
 sudo dd of=/sys/class/leds/apq8016-sbc:green:user2/brightness

Oh well. Thanks for the response.
I’d used the file control method doing the LinuxGettingStarted demos.
Built a little prototyping mezzanine board so I have interfaces for LEDs, Switches, and I2C at 3.3v & 5v to talk to the 1.8 I/O.

Funnily enough @mani was talking about libmraa at today’s OpenHours. I mentioned the gap w.r.t. LEDs.

Any plans to add it? Or do we stay with the file access way only?

No plans for LED access on libmraa as of now. So, I’d suggest you to stick to the way mentioned by @danielt . We’ll keep
you updated if there is any progress.


Hi @CmdrZin @danielt

LED support has been added to libmraa! Right now, PR is not merged but you can expect it to get merged in few days.

Note: Current implementation only supports C, C++ and python API’s.


Wanted to quick mention to anyone reading that these LEDs are used both for Debian and Android