Skip to main content

RGB LED

RGB LED

If you have not already done that, download drivers and examples code here.

C++

note

If you have not build the examples yet, perform the following commands:

cd C++
make

To check the LED example, you need to run this command:

cd Build
sudo ./LED

Python

Move to the folder with the code and run the example:

cd Python
sudo python LED.py

In this example, Navio2 LED changes color every second and outputs the color name to console.

LED is yellow
LED is green
LED is cyan
LED is blue

For further information, see source code. You can change LED color using led.setColor() function, which takes color name as an argument. List of colors defined in C++/Navio/Navio2/RGBled.cpp.