Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Servo.h>
- Servo myservo; // create servo object
- void setup() {
- myservo.attach(9); // attaches the servo on pin 9 to the servo object
- }
- void loop() {
- myservo.write(90); // sets the servo position to 90 degrees
- delay(1000); // waits for 1 second
- myservo.write(0); // sets the servo position to 0 degrees
- delay(1000); // waits for 1 second
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement