Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Servo.h>
- servo myServo;
- void setup(){
- myServo.attach(9);
- }
- void loop(){
- myServo.write(180); // 180 = forward
- delay(1000);
- myServo.write(90); // 180 = stop
- delay(1000);
- myServo.write(0); // 180 = backward
- delay(1000);
- myServo.write(90); // 180 = stop
- delay(1000);
- }
- // adjust the stop value as needed. I worked with a servo that had to be set to 90.
Advertisement
Add Comment
Please, Sign In to add comment