|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||
|
|||
|
Re: Counter loop
Posted by Joe Ross at 2/12/2001 7:14 PM EST
Engineer on team #330, Beach Bot, from Hope Chapel Academy and NASA/JPL , J&F Machine, and Raytheon. In Reply to: Counter loop Posted by Eric on 2/12/2001 5:24 PM EST: : If you want to time a motor out (say run it for 1 second and stop) and you wanted to do it more accuratly than simply counting loops (presumably bad data could thow this method off) what would the progam code look like? (I'm trying to get a handle on the delta_t kind of thing.) delta_t is the number of data packets that you missed. to be able to time things you should use the following idea: counter = couter + 1 + delta_t If delta_t is 0 then no data was lost and your program loop is less than 1/40th of a second. If delta_t is not zero, then you missed that many packets. using this code, when the counter reaches 40 then 1 second has passed. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Counter Strike | Gadget470 | Chit-Chat | 20 | 11-07-2005 14:03 |
| Actual execution time measurement | Dan | Technical Discussion | 5 | 24-03-2003 11:36 |
| How long is one stamp loop | yangotang | Programming | 3 | 23-01-2003 20:36 |
| Autonomous code | PBoss | Programming | 7 | 14-01-2003 15:29 |
| NEED HELP with Delay loop for compressor relay switch | archiver | 2001 | 10 | 24-06-2002 02:11 |