Go Down

Topic: Need help programming RGB's to be different colors  (Read 71 times) previous topic - next topic


Nov 18, 2017, 12:11 am Last Edit: Nov 18, 2017, 12:16 am by jastaggar132
Hello I am confused on how to add another code to another pin. I have attached my current design but I am having problems with programming the second RGB to blink. Any suggestions on what I could do? I would like the second RBG to blink primary colors only. I have also attached my code. My current design https://imgur.com/nPrfu5L


I have also attached my code
If you really wanted help, you'd have posted your code.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.


Kinda new to this but here

int redPin = 10;
int greenPin = 8;
int bluePin = 9;

void setup()
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);

void loop()

setColor(255, 255, 0); // yellow
setColor(80, 0, 80); // purple
setColor(0, 255, 255); // aqua
void setColor(int red, int green, int blue)
red = 255 - red;
green = 255 - green;
blue = 255 - blue;
analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);


Kinda new to this but here
No excuse for not reading the rules for using the forum - You still have not done this, and posted incorrectly!
http://www.uk-pcb.co.uk - UK Based PCB Fab & Assembly Company
Design & Assembly work undertaken - Arduino repairs & testing - PM for details. Arduino & C# PC programming.


Code tags missing.
No indentation making code hard to read.
Which of the code is for the first LED, and which part for the second? The code appears to be dealing with three LEDs total.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Go Up