|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: 1s Delay Affecting Driver Controls (FTC)
No problem! Here is a doc with some screen shots. This is kind of ugly because in our latest attempt, we pulled all of the references out of the loop. We also nest case statements about 5 levels deep. Is that a source for excessive delay (it doesn't seem like it should be)?
|
|
#2
|
|||||
|
|||||
|
Re: 1s Delay Affecting Driver Controls (FTC)
You should add a timer to each of your two parallel While loops to prevent one or the other from hogging the CPU. One loop could be starving the other loop. Add a 50ms Wait to the outer part of each While loop and that will periodically release the CPU to process other tasks.
Other than the obvious "Fire? = false" case causing a half second delay in that parallel loop, I don't see anything unusually slow in your code. Because it's parallel it shouldn't slow down the first loop. The nested Cases aren't a problem unless something time consuming happens in one of the hidden ones. Can't see where the first Tick Count goes off to, but I don't imagine you're doing anything unusual with that either. Last edited by Mark McLeod : 01-04-2010 at 09:31. |
|
#3
|
|||
|
|||
|
Re: 1s Delay Affecting Driver Controls (FTC)
Hmmm. I thought the timer would add more delay (i.e. wait) ... but now that you mention releasing the cpu, I think you may be on to something. We will give that a try. Thanks!
|
|
#4
|
|||||
|
|||||
|
Re: 1s Delay Affecting Driver Controls (FTC)
The timer will run in parallel with the other tasks inside the While loop, so you don't lose the full 50ms.
At most you'll lose 50ms. If that helps then you can experiment with shortening the time to 20ms or so. It really just needs to release long enough to allow the other loop to get a chance to run, so the time just has to be a little greater than how long the other code within the loop takes to execute. Last edited by Mark McLeod : 01-04-2010 at 10:29. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Driver Station Delay | alex42 | FRC Control System | 2 | 09-02-2010 20:14 |
| [FTC]: Toggle controls | nate15810 | FIRST Tech Challenge | 17 | 17-02-2009 11:13 |
| Bad Weather Affecting Teams | Tonya Scott 476 | General Forum | 77 | 15-02-2007 14:02 |
| pic: 383`s controls and driver | Manoel | Robot Showcase | 13 | 03-03-2005 00:57 |
| Ramp Affecting Robot Movement | Yan Wang | Rules/Strategy | 6 | 26-02-2003 08:27 |