| | IC loop Bill Rose
| | | Hope someone can help, I have just written my first code for my bot. All I have done so far is make my bot go forward in about a 4 foot square area. I am now wanting to put a loop in the code so that it will continue for a certain length of time or (...) (28 years ago, 23-Jan-97, to lugnet.robotics.handyboard)
| | | | | | | | Re: IC loop Fred G. Martin
| | | | | Hi Wade, You can use the "seconds()" function which reports elapsed time, plus a variable to keep track of when the loop should end: void main() { float end_time; end_time= seconds() + 20.; /* go for 20 seconds */ while (seconds() < end_time) { /* (...) (28 years ago, 23-Jan-97, to lugnet.robotics.handyboard)
| | | | | | | | | | Re: IC loop Richard Vannoy
| | | | | (...) There are a number of ways to do this in C. If you get the code that comes with the Handyboard, they have msleep(500L); which sleeps for 500 milliseconds (L for LONG Integer) and then returns to the calling program. My code is at work, but I'm (...) (28 years ago, 26-Jan-97, to lugnet.robotics.handyboard)
| | | | | | |