RGB LED Control Library

Hello All,

Just for the sake of experimenting I have written a library to do pretty much all I could think of with an RGB LED. I would appreciate someone trying it out and letting me know if you have any problems.

I used it with a single RGB LED connected to 3 PWM pins, but this could also be used with multiple LEDs and maybe with RGB strips as well.

I have included a sample sketch showing how to use all the functions. My personal favourite is the example cycling through the colours of the rainbow.

The library lets you do the following:

  • Turn the LED on and off
  • Flash the LED
  • Set the flashing speed
  • Fade between 2 colours gradually
  • Set the speed for the colour fading
  • Pulse the LED
  • Set the speed of pulsing
  • Change colour immediately
  • Set to white with a specified colour temperature
  • Set the brightness of the LED

This library is probably complete overkill for most applications, but maybe someone can use some parts of it.
With all these options there are plenty of applications I can think of. As a next step I want to set it up to be controlled over Ethernet (or Wifi on an ESP8266).

Let me know if you find it useful!
Kris.

RGBLED.zip (8.99 KB)