View Single Post
  #6   Spotlight this post!  
Unread 19-01-2008, 11:57
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,650
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Robot Timing Code

Quote:
Originally Posted by robotrobot2 View Post
The TMR0H and TMR0L bytes are built into the processor. They execute regardless of the code, as does the interrupt.
You misunderstand me. The timer and timing functions will work just fine. Using floats on these robots makes me cringe, but it will work. But your wait(inp) function will kill the robot as sure as pulling the battery. The master processor HAS to be updated by user processor periodically, if you don't the watchdog timer goes off and the master processor kills the robot. If you enter your while loop there you can to NOTHING but wait and can't update the master processor. So the watchdog times out and the master processor kills the robot.

I'm making a fuss about this because it's one of the most common mistakes made by rookie programmers and I really would rather there wasn't code out there that made killing your robot as simple as calling a function.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter