Hello guys,i have a problem in my program.I made a program in PC using C++ to send some characters via RS-232 to a PIC16F628A microcontroller,that takes a character and compares to a valor that have to be put in that routine below:
Just to test this routine
int time=1500;
For(int i=0;i<50;i++)
{
output_high(pin_b7);
delay_us(time);
output_low(pin_b7);
delay_us(20000);
}
When i do this,this routine don't work at all,the servo just run to the final position,don't matter what valor the time is.
But if i do this:
For(int i=0;i<50;i++)
{
output_high(pin_b7);
delay_us(1500);
output_low(pin_b7);
delay_us(20000);
}
This works...
What am i doing wrong here?