View Single Post
  #8   Spotlight this post!  
Unread 20-02-2014, 08:42
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,855
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: Autonomous starving teleop?

I see Two DIO 3's are defined in Begin.

It looks like the problem is with Periodic Tasks sucking up all your CPU.
It's probably because one or more of your 20ms loops takes more than 20ms to execute regularly.
I suspect Engatiha e atira, because the bad DIOs get checked there every 20ms.

Greg has provided a nice tool that you'll find in your project window under Support Code called Elapsed Time.
You can drag & drop an instance of that into each of your loops (and feed it a unique name so you can tell which one it is) to see how fast they run in the Debug front panel of Elapsed Time.
Any of your loops that regularly take much (the loops will always be a few ms slower than the time you set) longer than the 20ms or whatever delay you gave them, will occupy your CPU 100%, because they never get a rest.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 20-02-2014 at 10:12.