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(2); // attaches the servo on GPIO D4 to the servo object
- }
- void loop() {
- myservo.write(0); // tell servo to go to position in variable 'pos'
- delay(500);
- myservo.write(180);
- delay(500);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement