Last active
July 10, 2018 15:30
-
-
Save li2hub/d56f2fdb289539cbaef8d2eddbb5635d 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> // Include the Servo library | |
int servoPin = 3; // Declare the Servo pin | |
Servo Servo1; // Create a servo object | |
void setup() { | |
Servo1.attach(servoPin); // We need to attach the servo to the used pin number | |
} | |
void loop(){ | |
Servo1.write(0); // Make servo go to 0 degrees | |
delay(1000); | |
Servo1.write(90); // Make servo go to 90 degrees | |
delay(1000); | |
Servo1.write(180); // Make servo go to 180 degrees | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment