View Single Post
  #4   Spotlight this post!  
Unread 04-08-2010, 15:28
siaohuang siaohuang is offline
Registered User
no team
 
Join Date: Aug 2010
Location: Fort Wayne IN
Posts: 10
siaohuang is an unknown quantity at this point
Re: Delay10KTCYx in C18

I have it to work thank you!!

This is what I did
Code:
static int counter=0;


pwm02=100;
pwm03=155;

counter= ++counter ;

if(counter>271){   (5/18.5ms)
  pwm02=127;
  pwm03=127; 
}
and the robot moved for 5 seconds and it stopped! What I'm doing right here is the way Foster suggested right ? I think the both of you are doing the same thing right? I have a question about the 18.5ms is it true that no matter how long the code, it will always take 18.5ms in the loop?

Also MARK can you show me how to write the Wait subroutine?

I can't thank you guys enough! You've been such great help!

Last edited by siaohuang : 04-08-2010 at 15:32.