Datasheet
Still Not Working
A mistake we made a time or
two was simply forgetting to
connect the power (red and
brown wires) to +5 volts and
ground.
15
CIRC-04
File > Examples > Servo > Sweep
(example from the great arduino.cc site, check it out for other great ideas)
More details, where to buy more parts, where to ask more questions:
http://ardx.org/CIRC04
Servo Not Twisting?
Even with colored wires it is
still shockingly easy to plug a
servo in backwards. This might
be the case.
Potentiometer control:
void loop() {
We have yet to experiment with inputs but if you would like
int pulseTime = 2100; //(the number of microseconds
//to pause for (1500 90 degrees
to read ahead, there is an example program File > Servo >
// 900 0 degrees 2100 180 degrees)
digitalWrite(servoPin, HIGH);
Knob. This uses a potentiometer (CIRC08) to control the
delayMicroseconds(pulseTime);
digitalWrite(servoPin, LOW);
servo. You can find instructions online here:
delay(25);
http://ardx.org/KNOB
}
Great ideas:
Self timing:
Servos can be used to do all sorts of great things, here are a few of
While it is easy to control a servo using the Arduino's included
our favorites.
library sometimes it is fun to figure out how to program
something yourself. Try it. We're controlling the pulse directly
Xmas Hit Counter
so you could use this method to control servos on any of the
http://ardx.org/XMAS
Arduino's 20 available pins (you need to highly optimize this
code before doing that).
Open Source Robotic Arm (uses a servo controller as well as the Arduino)
http://ardx.org/RARM
int servoPin = 9;
void setup(){
Servo Walker
pinMode(servoPin,OUTPUT);
http://ardx.org/SEWA
}
// Sweep
// by BARRAGAN <http://barraganstudio.com>
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
Fits and Starts
If the servo begins moving then
twitches, and there's a flashing
light on your Arduino board, the
power supply you are using is
not quite up to the challenge.
Using a fresh battery instead of
USB should solve this problem.
NOT WORKING? (3 things to try)
MAKING IT BETTER
CODE (no need to type everything in just click)
MORE, MORE, MORE: