Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<Servo.h>
- Servo the_servo;
- int pos = 0;
- void setup() {
- // put your setup code here, to run once:
- the_servo.attach(9);
- pinMode(11, OUTPUT);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- delay(100);
- for(int i=0; i<=180; i++)
- {
- the_servo.write(i);
- delay(100);
- }
- delay(100);
- for(int i=180; i>=0; i--)
- {
- digitalWrite(11, 200);
- the_servo.write(i);
- delay(10);
- }
- digitalWrite(11,0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement