Skip to content

Instantly share code, notes, and snippets.

@maximeadjigble
Created May 2, 2019 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maximeadjigble/d89ffc865ae60ac27f285cbe7fcffce1 to your computer and use it in GitHub Desktop.
Save maximeadjigble/d89ffc865ae60ac27f285cbe7fcffce1 to your computer and use it in GitHub Desktop.
#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