#define RED_PIN 34
#define GREEN_PIN 35
#define BLUE_PIN 32
#define BUTTON_PIN 2
void setup() {
pinMode(RED_PIN, OUTPUT);
pinMode(GREEN_PIN, OUTPUT);
pinMode(BUTTON_PIN, INPUT);
}
void loop() {
if (digitalRead(BUTTON_PIN) == HIGH) {
// Button is pressed
analogWrite(RED_PIN, 0); // Red off
analogWrite(GREEN_PIN, 255); // Green on
} else {
// Button is not pressed
analogWrite(RED_PIN, 255); // Red on
analogWrite(GREEN_PIN, 0); // Green off
}
}