|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Timer Question
Hi, our incredible plans to create an autonomous mode has failed (once again
) and im thinking we will have to rely on timers again. Last year, we used EasyC, but this year we're using MPLab. We have the idea of having a timer based on the number of loops. We believe each loop is 26.2 ms, so can we take this number and loop it xx times and increasing a counter each loop until it reaches the specific time?example, we want to move 5 seconds forward 5s = 5000ms = 190 loops. static int timer = 0; **move forward**; if (timer <190) timer = timer +1 ; if (timer >=190) **stop**; Thanks!! |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Timer questions | Rick TYler | Programming | 3 | 12-02-2006 19:24 |
| Quick Timer Question | et1337 | Programming | 3 | 02-02-2006 15:19 |
| Accelerometer Timer Question | psquared | Programming | 3 | 12-02-2005 01:34 |
| timer | omega | Programming | 3 | 30-03-2004 18:52 |
| Timer Preview | Nate Smith | General Forum | 2 | 05-03-2003 12:25 |