void setup() {
pinMode(0, INPUT); //THE BUTTON
pinMode(3, OUTPUT); //RED PIN
pinMode(2, OUTPUT); //GREEN PIN
pinMode(1, OUTPUT); //BLUE PIN
}
//when the button is pressed the blue and green lights turn on
//this causes a yellow color.
//please note, there are lots of resistors.
//these are built in on our arduinos.
void loop() {
if (digitalRead(0) == HIGH) {
digitalWrite(1, HIGH);
digitalWrite(2, HIGH);
} else {
digitalWrite(2, LOW);
digitalWrite(1, LOW);
}
}