View Single Post
  #4   Spotlight this post!  
Unread 01-04-2010, 08:44
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,795
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
Attached Thumbnails
Click image for larger version

Name:	loopdelay.jpg
Views:	29
Size:	5.7 KB
ID:	8960  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 01-04-2010 at 09:31.
Reply With Quote