Created
March 1, 2017 17:38
-
-
Save michaelsarduino/e2b7a24a8643ac0f79ee83391e21e6f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> //Nachladen der Servo Bibliothek | |
int ServoPin = 10; //Festlegen des Pins | |
Servo servo; //Erzeugen des Servo Objekts | |
int servoAngle = 0; | |
void setup() | |
{ | |
servo.attach(ServoPin); //Festlegen des Pins im Servo Objekt | |
servo.write(90); //Bewegen zum Winkel 90 Grad (=Mitte) | |
} | |
void loop() | |
{ | |
servo.write(135); | |
delay(1000); | |
servo.write(90); | |
delay(1000); | |
servo.write(45); | |
delay(1000); | |
servo.write(90); | |
delay(1000); //Drehen des Servo Motors | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment