Skip to content

Commit

Permalink
Code for making two servos pan
Browse files Browse the repository at this point in the history
  • Loading branch information
DMorris42 committed Jul 27, 2014
1 parent cfdc73c commit 59c644b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions basic_servo.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//Sweeps two servos on pins 10 & 11 (servo port 5, S5 on port schematic)

#include <Servo.h>

Servo servo1;
Servo servo2;

int i = 0;

void setup() {
servo1.attach(11);
servo2.attach(10);
servo1.write(90);
servo2.write(90);
}

void loop() {
for (i = 0; i < 180; i++) {
servo1.write(i);
servo2.write(i);
delay(8);
}
for (i = 180; i > 1; i--) {
servo1.write(i);
servo2.write(i);
delay(8);
}
}

0 comments on commit 59c644b

Please sign in to comment.