Go Down

Topic: Library for RGB LEDs (Read 24021 times) previous topic - next topic


Nice library.

Does it use delay in any part of the code? Or its based on Time0?


Hello and thanks for your work!

Why do you use uint16_t instead of uint8_t for the colors as the PWM outputs can accept only a number between 0 and 255?


That's really a absolute useable Library.

One feature i think is missing:

The ready-to-use Controller for RGB Stripes have a brightness control feature where you are able to choose about 5-10 different brightness steps.

Would that be easy to adapt or not?

Thanks Thomas

Any news on that? Great library but brightness is missing!!


Nice library. Have you created any new moods for it?


Aug 04, 2015, 02:21 am Last Edit: Aug 04, 2015, 03:16 am by AVisual
Hey Pollop,

Sorry i'm a total noob, but:

was just wondering is this non blocking code?

Code: [Select]
const int redPin = 9;
const int greenPin = 10;
const int bluePin = 11;
#include <RGBMood.h>
RGBMood m(redPin, greenPin, bluePin);

void setup() {
m.setMode(RGBMood::RANDOM_HUE_MODE);  // Automatic random fade.
m.setHoldingTime(4000);  // Keep the same color for 4 seconds before fading again.
m.setFadingSteps(150);   // Fade with 150 steps.
m.setFadingSpeed(50);    // Each step last 50ms. A complete fade takes 50*150 = 7.5 seconds
m.setHSB(random(359), 255, 255) // Random hue mode only change the hue so we first set the saturation and brightness to what we want.

void loop() {
m.tick(); // Update the colors.


Hello, thanks for this nice and usefull library, I started as a noob a few months ago, playing with the arduino.
I would like to use this for setup a BT communication between serial RGB strips and my phone.(Everything works, biut without the use of your laibrary).
The thing I can't solve is the following.
In tick you directly send the RGB-value to the used pins.
Because I need a serial comminucation for sending the value to the used drivers, I just need the value for sending them further.

Here's an example :

#include "RGBdriver.h"
#define CLK 3//pins definitions for the driver        
#define DIO 2
RGBdriver Driver(CLK,DIO);
void setup()  

void loop()  
 Driver.SetColor(100, 0, 0);  //Send Red to the first driver

It's perhaps very easy to change this, but for the moment I didn't found it.

I'll hope, it's a bit clear.

Thanks in advance


Hello,thanks for your best library.
i had some problem in my code . i use switch case  for moods of library to switch between led fade moods.when i switch rainbow mood,it is run good but you are not consider code for stop them and i cant stop switched mood after start to fadding.when i switching the other case of mood still previous mood is runing,new mood doesnt work.how i can stop previous mood and then switch to run new mood?

Go Up