#define LED 13
#define Button 5
void setup() {
// put your setup code here, to run once:
pinMode(Button,INPUT_PULLUP);
pinMode(LED, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(Button) == LOW) {
if(digitalRead(LED) == HIGH){
digitalWrite(LED, LOW);
delay(250);
} else {
digitalWrite(LED, HIGH);
delay(250);
}
//warten bis Taster Pin wieder HIGH
//while do Schleife
//do {
// }while(digitalRead(Button) == LOW) {
//mache nichts
// }
//for(;digitalRead(Button) == LOW;) {
// }
delay(125);
}
}