Subject:
|
IC loop
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Thu, 23 Jan 1997 03:22:12 GMT
|
Original-From:
|
Bill Rose <brose@ipa.net^StopSpammers^>
|
Viewed:
|
1149 times
|
| |
| |
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 count. I think I should probably use the while expression but I am not
sure how to do this. Can anyone help me out. I am just beginning to pick
up on the IC code so I may be asking a really dumb sounding question but I
guess that is how you learn. I would appreciate anyones help.
Thanks in Advance,
Bill Rose
Fort Smith, AR
|
|
Message has 2 Replies: | | Re: IC loop
|
| 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
|
| (...) 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)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|