Hey guys,
Made a custom delay function so that it could take variables since __delay_us(); doesnt
function is void delay_us(int a)
{
for(int i = 0; i < a; i++)
{__delay_us(1);}
}
simple as they come.
Yet when I put 1500 (center the servo) it freaks out where using the inbuild delay function works.
In fact the delay time (a) to center with this function is 55?!?!!?
what is going on here. i realise that the function may be a little laggy but that much/?
May help to start at the other end.
Use a scope or logical analyzer (or PICkit logic tool) to look at the signal sent to the servo.
Then ask yourself why it is generating that signal. Post it here.
Actually, for model servos, it is more a function of pulse width. You can change the duty cycle considerably, but keep a constant pulse width, and position won't change.
Actually, for model servos, it is more a function of pulse width. You can change the duty cycle considerably, but keep a constant pulse width, and position won't change.