Created
May 2, 2019 11:28
-
-
Save maximeadjigble/d89ffc865ae60ac27f285cbe7fcffce1 to your computer and use it in GitHub Desktop.
This file contains 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> | |
int servoPin = 3; | |
Servo myservo; | |
void setup() { | |
myservo.attach(servoPin); | |
} | |
void loop() { | |
for( int pos = 0 ; pos <= 180; pos++){ | |
myservo.write(pos); | |
delay(15); | |
} | |
for( int pos = 180; pos>= 0; pos--){ | |
myservo.write(pos); | |
delay(15); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment