Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Servo.h>
- Servo myservo; // create servo object to control a servo
- void setup() {
- myservo.attach(9,900,2300); // (pin, min, max)
- }
- void loop() {
- myservo.write(0); // tell servo to go to a particular angle
- delay(1000);
- myservo.write(90);
- delay(500);
- myservo.write(135);
- delay(500);
- myservo.write(180);
- delay(1500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement