const int Taster = 12;
const int LED = 2;
bool JA = false;
bool Schleife = false;
bool LEDSTATUS = true;
long unsigned int Zahl;
void setup() {
pinMode(LED, OUTPUT);
pinMode(Taster, INPUT_PULLUP);
}
void loop() {
if(digitalRead(Taster) == LOW){
Schleife = true;
Zahl = millis();
while((digitalRead(Taster) == LOW) && (Schleife == true)){
if(millis() - Zahl >= 5000){
JA = true;
Schleife = false;
}
}
}
if(JA == true){
digitalWrite(LED, LEDSTATUS);
LEDSTATUS = !LEDSTATUS;
while(digitalRead(Taster) == LOW){
delay(50);
}
JA = false;
}
}