I'm having some trouble getting my servo to work for continuous rotation, I am using a HS-422 servo. I have tried the way described on
http://www.societyofrobots.com/member_tutorials/node/82 ( I also tried the traditional method of turning the pot head until the servo stops spinning but my hands are not steady enough for it). Right now I have it setup like this,
Red Wire-Resister-Yellow Wire-Resister-Green Wire.
The yellow wire was the one in the center of the pot so it should be working but when I send it a 1.5ms pulse it just keeps spinning to the left. If I measure the resistance across one of the resisters (Like from the red wire to the yellow) it only comes up at about 1.5kohms, is this normal? The resisters I used are 2.2kohm, 2% tolerance. I didn't think to measure the resisters beforehand but the other resisters from the pack do have near the correct resistance (They are both around 2.16 kohms).
Here is the code I am using,
#include <avr/io.h>
#define F_CPU 100000UL
#include <util/delay.h>
void main(void)
{
DDRB = 0xFF; //Configure all B ports for output
while (1)
{
PORTB = 0xFF;
_delay_ms(1.5);
PORTB = 0x00;
_delay_ms(10); //Not sure if this should be 10ms or 20ms, though I have tried both
}
}
It seems really simple to me, I don't know what could be wrong with it.
I have seen that some people use timers to get the correct pulses but the book I have been reading about C programming with AVR's says that unless the timer clock is calibrated it has a tendency to be inaccurate, and that calibration requires the use of an external crystal.
Could anyone tell me what I may be doing wrong?