Controlling the RGB LED on the Expansion Dock
Omega Tip of the Week:
2-Minute Tutorial on Controlling the Expansion Dock’s RGB LED
You know that little red light that comes on when the Expansion Dock is powered? It’s actually an RGB LED! Here’s a quick tutorial on how to control it. Before we begin, always make sure your Omega is on the latest firmware.
The command looks like this:
where RRGGBB is a hex number with two digits each for red, green, and blue respectively (00 – FF). The higher the number for each color, the brighter they will be. Here are some examples:
expled 790000 # red expled 00EF00 # blue expled 00004B # green expled 990700 # gold expled 4B123F # violet
How it Works
There are three GPIOs connected directly to the LED:
- GPIO 15 – Blue
- GPIO 16 – Green
- GPIO 17 – Red
The program uses the fast-gpio utility to generate a software-based pulse width modulation signal on those three pins. For more details on how you can use fast-gpio in your own projects, check out our guide in our documentation.
The LED pins are active low, meaning that the lower the duty cycles are, the higher the current draw and thus the brightness.
The PWM signals generated on the three GPIOs are modulated by the processor in software. This means that if you run intensive tasks on the Omega, the colors of the LED may be affected.
And that’s it! For full details on using the Expansion Dock, check out our guide in our documentation.
Let us know what kind of stuff you would like to see featured on 2-Bullet Tuesday! Send a tweet to @OnionIoT with your suggestions!
Thanks for reading! Have a great week!
P.S. — Our Omega2 Indiegogo campaign will be ending in the near future! Don’t miss your chance to get the Omega2 for just $5!
P.P.S — We’re shipping packages on a daily basis! If you haven’t gotten yours yet, sit tight!