![]() |
Timers | Contents | Master Index |
CyberMaster | RCX | RCX2 | Scout |
ClearTimer() | Reset the specified timer to 0. | ||||||
SetTimer() | Set a timer to a specific value (which may be any expression). |
VALUES / QUERIES
Timer() | Return the current value of specified timer (in 100ms resolution). | ||||||
FastTimer() | Return the current value of specified timer (in 10ms resolution). |
All targets provide several independent timers with 100ms resolution (10 ticks per second). The Scout provides 3 such timers while the RCX and CyberMaster provide 4. The timers wrap around to 0 after 32767 ticks (about 55 minutes). The value of a timer can be read using Timer(n), where n is a constant that determines which timer to use (0-2 for Scout, 0-3 for the others).
|
RCX2 provides the ability to read the same timers with higher resolution by using FastTimer(n), which returns the timer's value with 10ms resolution (100 ticks per second). |
FUNCTIONS / COMMANDS |
|
ClearTimer(n) | Overview | Top | ||||||
Reset the specified timer to 0. ClearTimer(0); | |||||||
SetTimer(n, value) | Overview | Top | ||||||
Set a timer to a specific value (which may be any expression). SetTimer(0, x); | |||||||
VALUES / QUERIES |
|
Timer(n) | Overview | Top | ||||||
Return the current value of specified timer (in 100ms resolution). x = Timer(0); | |||||||
FastTimer(n) | Overview | Top | ||||||
Return the current value of specified timer (in 10ms resolution). x = FastTimer(0); | |||||||