Society of Robots - Robot Forum

Software => Software => Topic started by: LoboBranco on August 30, 2009, 03:38:20 AM

Title: Servo delay routines problem,help please
Post by: LoboBranco on August 30, 2009, 03:38:20 AM
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?
Title: Re: Servo delay routines problem,help please
Post by: Admin on September 15, 2009, 01:12:49 PM
Have it flash an LED every second, and/or use a multimeter.

This will show you where the problem is.