Last active
July 22, 2018 10:29
-
-
Save li2hub/f5297e303f6d5b2ace3f6bf0c25d0fe0 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 = 5; // 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