const int LED_PIN = 9;
const int BUTTON_PIN = 2; // Button to increase red brightness
int helderheid = 0;
void setup() {
pinMode(LED_PIN, OUTPUT);
pinMode(BUTTON_PIN, INPUT_PULLUP);
}
void loop() {
if (digitalRead(BUTTON_PIN) == LOW) {
if (helderheid < 255) {
helderheid = helderheid + 1;
}
} else {
if (helderheid > 0) {
helderheid = helderheid - 1;
}
}
analogWrite(LED_PIN, helderheid);
delay(20); // Short delay to limit update speed
}