Circuit works when you test each pin and RGB LED lead.
But in my loop, as soon as I add an additional lead to manipulate,
none of the code works.
const int redPin = 7;
const int greenPin = 6;
const int bluePin = 5;
void setup() {
Serial.begin(9600);
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop() {
//Lights up the redPin without issue
Serial.println("Writing to redPin");
analogWrite(redPin, 254);
delay(1000);
analogWrite(redPin, 0);
delay(1000);
/* As soon as I add another pin to the mix,
If I comment out the redPin and the bluePin and just use the greenPin, it works fine.
Serial.println("Writing to greenPin");
analogWrite(greenPin, 254);
delay(1000);
analogWrite(greenPin, 0);
delay(1000);
//Same with the bluePin, works fine on its own, but doesn't work when another pin is added
Serial.println("Writing to bluePin");
analogWrite(bluePin, 254);
delay(1000);
analogWrite(bluePin, 0);
delay(1000);
*/
}