What?

Hi, Im using an arduino duemilanove and an HS-322HD stepper motor. When I plug it in and use even simple sample code the motor wont run. If i compile the code, then unplug it the motor will turn some odd degrees 7-8 times then stop. Ive tried everything from messing with the baud rate to the COM ports and nothing seems to affect the motor. I have a charger and a USB cable so i don't think power is the problem. Ive used 2 different computers and it does the same thing on both?

Im pretty sure im missing something obvious. Does anyone have an idea?

HS-322HD stepper motor

First off, terminology: The HS-322HD is a servo, not a stepper. Big difference.

Secondly, can you supply us with -your- schematic/hookup diagram and the code -you- are using (don't just point us to things online - we need to see what you are doing, not what somebody else has done - simply because you may have made a mistake with the code or wiring, and we can't see that with somebody else's diagram/code).

:)

I have the signal attached to pin 9, power attached to 5v and ground attached to ground (obviously)
Here is my code:
#include <Servo.h>

Servo myservo;

int pos = 0;

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

void loop()
{
for(pos = 0; pos < 180; pos += 20)
{
myservo.write(pos);
delay(5000);
}
for(pos = 180; pos>=1; pos-=20)
{
myservo.write(pos);
delay(5000);
}
}

No matter how i change my code the motor does the same thing. which leads me to believe its not even reading my code. =/

How are you wiring/powering this?
Are you using a seperate power supply?

No, i have the motor plugged into the board. The arduino is plugged in with the charger and the USB.

Just to verify - from your servo; you have the black wire going to ground, red to power (4.8 to 6 volts), and the white wire connected to pin 9, right?

What Pauly was asking about was whether you were driving the servo with a separate supply (this can be important, as the regulator on the Arduino may not be powerful enough to supply current for both the Arduino and the servo)...?

Also - have you tested this servo in any other manner to verify that it is good and working (servo tester, r/c radio, etc)? If not, you might want to check this as well - even "brand new" servos can be "dead" from the shop (generally because of vendor "return and resell" more than anything - but sometimes, even the factory ships out dud servos).

Yeah i knew what he was getting at. I tried the motor with a more powerful power supply just now and it worked. Thanks :)