RMRobotics / FTC_5421_2014-2015

Assets for 2014-2015 Team 5421 FIRST Tech Challenge.
MIT License
6 stars 1 forks source link

Rewrite code in JoyAuxiliary/Autonomous to use nPgmTime #67

Open jimmyli97 opened 9 years ago

jimmyli97 commented 9 years ago

The way we're currently using timers to measure time elapsed is very confusing and requires specialized calls to ClearTimer(), etc because the time in milliseconds is limited to 16 bits in size.

We can just use nPgmTime instead (documented here). This holds a global timer that holds time since the program has started in milliseconds. It's type long, which is a 32 bit positive numerical value, so basically this thing will run for at least a day without overflowing. That's what we really wanted, but I didn't know that existed until now :/

jimmyli97 commented 9 years ago

The other option is to write the timer library as described in #66 and use that!