Metainformationen zur Seite
  •  

Scheibenwischerprogramm

#include <Servo.h> 
 
Servo myservo;
 
int tasterPin = 3;
boolean status;
 
void setup() {
  myservo.attach(2);
  myservo.write(0);
  delay(50);
 
  pinMode(tasterPin, INPUT_PULLUP);
  status = true;
}
 
void loop() {
  if(!digitalRead(tasterPin)) {
    status=!status;
    delay(250);
  }
 
  if (status) {
    myservo.write(180);
    delay(500);
    myservo.write(0);
    delay(500);
  }
}