Skip to content

Instantly share code, notes, and snippets.

@esmarr58
Created March 1, 2018 06:37
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 esmarr58/985a8402cd51ed95e27e9cac0eadad2d to your computer and use it in GitHub Desktop.
Save esmarr58/985a8402cd51ed95e27e9cac0eadad2d to your computer and use it in GitHub Desktop.
#include<Servo.h>
int angulo = 0;
Servo motor1; //Agregar un objeto servo
void setup() {
motor1.attach(3);
}
void loop() {
motor1.write(angulo);
delay(100);
angulo++;
if(angulo>180) angulo = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment