Author Topic: Servo delay routines problem,help please  (Read 1557 times)

0 Members and 1 Guest are viewing this topic.

Offline LoboBrancoTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Servo delay routines problem,help please
« 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?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Servo delay routines problem,help please
« Reply #1 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.

 


Get Your Ad Here

data_list