Hello!
I am very new to Arduino and I am trying to make three rgb LEDs light up with different colors each at the same time. (i'm trying to make a traffic light that works well for colorblind persons) I modified an example for one LED but it's not displaying the correct colors on the second two leds
it should display (dark wine purply red, electric greenish yellow, bright cyan/teal)
however, it displays (dark wine purply red, bright yellow, bright green)
I can get all of the correct colors to appear on the first led, so I think its a problem with the code. Could someone take a look at this for me, and let me know if I'm doing something wrong? I know next to nothing about Arduino but I know Processing very well so I tried to just figure it out.
int redPin = 11;
int greenPin = 10;
int bluePin = 9;
int redPin2 = 7;
int greenPin2 = 6;
int bluePin2 = 5;
int redPin3 = 4;
int greenPin3 = 3;
int bluePin3 = 2;
void setup()
{
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(redPin2, OUTPUT);
pinMode(greenPin2, OUTPUT);
pinMode(bluePin2, OUTPUT);
pinMode(redPin3, OUTPUT);
pinMode(greenPin3, OUTPUT);
pinMode(bluePin3, OUTPUT);
}
void loop()
{
setColorStop(120, 17, 84);
setColorCaution(160, 206, 14);
setColorGo(87, 206, 188);
}
void setColorStop(int red, int green, int blue){
analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);
}
void setColorCaution(int red, int green, int blue){
analogWrite(redPin2, red);
analogWrite(greenPin2, green);
analogWrite(bluePin2, blue);
}
void setColorGo(int red, int green, int blue){
analogWrite(redPin3, red);
analogWrite(greenPin3, green);
analogWrite(bluePin3, blue);
}