Help with Mardi Gras LED 3 Color Display

Hello all and thanks for reading.
Bottom line up front:
I want to create a custom 3 color fade using Arduino and my 12v RGB LED lights.

I have 12v RGB LED strips attached to the house. It stays up year round.
The built in App that came with the lights has a feature for "3 color Fade", however, It only will fade Red, Green and Blue.
I want to use Arduino to create a custom 3 color fade with the colors I want.
I.e. Purple, Green, Gold for Mardi Gras.... Orange, Yellow, brown for Halloween, etc.
I understand how to use MOSFET to connect the Arduino to the LED lights.
Following tutorials, I understand a little how to use a code to get the lights to fade between 3 colors, But all the tutorials just have Red, Green, and Blue as the fade colors.
Is it possible to change the 3 colors to whatever I want?
And if so, Could someone help with the sketch or point me to the right resources?
Thank you

Hi @erdayo

Take a look at how the RGB LED strip is controlled in this tutorial:

Here is some simple code for how to control a RGB LED strip:

#define red 2
#define green 3
#define blue 4

int RED;
int GREEN;
int BLUE;

void setup(){
  pinMode(red, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(blue, OUTPUT);
}

void loop(){
  ledStrip(0,0,255); //blue
  delay(1000);
  ledStrip(0,255,0); //green
  delay(1000);
}

void ledStrip(RED, GREEN, BLUE){
  analogWrite(red, RED);
  analogWrite(green, GREEN);
  analogWrite(blue, BLUE);
}

Thank you very much.

This may be of interest: https://arduinoplusplus.wordpress.com/2020/06/11/neopixel-fades-and-color-transitions/

Thank you. I wish I could say it did, but it just confused me more.
Great tutorial on making a fading effect but I couldn't figure out how to do it with just specific colors that I wanted.
I appreciate the reply!

Simply, every color can be expressed as a combination of Red, Green and Blue (RGB). You can use a color picker to get the fade start and fade end RGB values easily (eg, here or any 'Paint' type application). The rest is just a linear interpolation between the two explained in the blog post.

You want to go between Orange, green brown, then you get the RGB values of the three colors and go between orange and green, then green to brown, then brown back to orange (round and round) or you can pick a random one to go to next to mix it up.

1 Like

Yes thank you.
I understand the concept you stated but unfortunately I don't have much sketch experience and I'm not sure how to modify existing code or write my own to get it how I want.
I appreciate your input though as you seem to really have a handle on it.

Getting an led to show brown is almost impossible. Brown is one of those colours that exists only in the mind, in the context of the other colours in a scene.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.