Servo...?? i

hello i just got my arduino and im trying to get this to work but i can't seem to find the problem.. it seem it my be a software or hardware.. i have some servos here and they all have the some problem.. and i think its the servo them self. im just trying to do a sweep from 1 side to another and . it move all the way to 180* and move to 100* and then back. and it make a clicking sound to it.. when it get to 100*. i play with the seting and nothing.. it keep the same path. know i have no clue what going on.. anyone that can help would be great.

#include <Servo.h>

Servo myservo;

int pos = 0;

void setup()
{
myservo.attach(9);
}

void loop()
{
for(pos = 0; pos < 180; pos += 1)
{
myservo.write(pos);
variable 'pos'
delay(15);
position
}
for(pos = 180; pos>=1; pos-=1)
{
myservo.write(pos);
variable 'pos'
delay(15);
position
}
}

Is your servo capable of moving through a 180 sweep? Some servos are continuous rotation "servos" (which really aren't servos), some are 180 degree rotation servos, and some are 90 degree servos.

If you move it (gently) by hand, does it sweep 180 degrees, or does it sweep less than that?

If it does sweep 180 degrees, are you starting with the servo positioned at 0 degrees?

Have you tried the "servo knob" tutorial. It is very simple, and it would at least eliminate the possibility of problems in the code.

The tutorial is here:

Yes the servo moves 180* and the some i have was in a old RC plain i have so i know they work fine.. allso if i move the servo (by hand) to post 0* it move over to about 100* and then 180* but it seem to me that its trying to go pass 180*

Most hobby servos do NOT have 180* of travel.
The typical spread sent by the RC receiver is +- 50*
With a little adjustment for end point, you get about 120*
With the signal being controlled from our code, we can send signals beyond those ranges. And the servo will accept that up to the limit of the physical gearing, or the electronics in the servo.
If I go much beyond +-80*, the HS311 go dead, with the servo moving freely until I send a signal between +-80* or so.
Other servos just stop when the get a signal beyond their acceptable range.
Test to find the limits of the servo. Did anyone mention the servo knob tutorial? :wink:

This is all it wants to more.. i change the limtes and upload it and still the same..

here a link to see what it dose - YouTube