Quote:
Originally posted by randomperson
[I needed a value this large] for use in a really high-res counter loop related to speed regulation.. we were brainstorming stupid ideas and this happened to come up as part of one of those..
|
If there is any branching at all, your loop time will be variable, so don't depend on it if you need a PRECISE time interval (such as "do <this> at EXACTLY 5.5 seconds before the end of the round").
Here's a HARDWARE solution for LONG (multi-second) times that's VERY repeatable: Create a simple one shot timer with a 555, and put it in the Electronics Box. Trigger it with a digital output, and read the status back with a switch input. If you wish a VERY precise time interval, you can make the timer out of a PIC micro, a "long range timer chip" (such as an EXAR XR-2242), or a crystal oscillator brick driving a counter/divider chain and some simple "done" gate logic.
However, since the rules state you may ONLY drive functional robot devices with the RC outputs ("active decorations" are the only exception), in reality you're still limited to the time resolution of One Loop in any case. Therefore, a 555 timer will probably be just as good as something more elaborate. That circuit should only cost a couple of bucks to make.
Don't forget that they MAY stop then continue a round for many reasons, so you should NEVER assume "powerup = start of two minute round"! A multi-minute timer (software OR hardware) to automatically trigger your 'near end of round surprise' may never time out if they stop the round, so you'll also need a driver manual trigger.
- Keith