const int TASTER_GRUEN = 5;
const int TASTER_BLAU = 4;
const int TASTER_GELB = 3;
const int LED_ROT = 11;
const int LED_CYAN = 10;
const int LED_VIOLETT = 9;
unsigned long VergangeneMillis;
unsigned long AlteMillis = 0;
unsigned long interval = 500;
bool ZustandSeriel = LOW;
void setup() {
// put your setup code here, to run once:
pinMode(LED_ROT, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
VergangeneMillis = millis();
if (VergangeneMillis - AlteMillis >= interval){
AlteMillis = VergangeneMillis;
bool zustandLED_ROT = digitalRead(LED_ROT);
digitalWrite(LED_ROT, !zustandLED_ROT);
}
if (digitalRead(LED_ROT) == HIGH && ZustandSeriel == LOW){
Serial.println("LED wurde eingeschaltet");
ZustandSeriel = HIGH;
}
else if (digitalRead(LED_ROT) == LOW && ZustandSeriel == HIGH){
Serial.println("LED wurde ausgeschaltet");
ZustandSeriel = LOW;
}
}