Temporizador#
Introducción#
The VEX AIM Coding Robot’s timer keeps track of elapsed time from the start of a project. It can be used to measure how long something takes, trigger events after a set time, or reset for new timing operations.
A continuación se muestra una lista de todos los bloques:
reiniciar temporizador — Reinicia el temporizador a cero.
timer in seconds — Reports how much time has passed.
cuando el temporizador — Ejecuta una pila de bloques después de que el temporizador exceda un tiempo especificado.
reiniciar el temporizador#
The reset timer stack block resets the timer to zero. This can be used to start timing a new part of a project without restarting the whole project.
reset timer
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
when started
[Display the time the robot takes to turn right.]
move [forward v] for (20) [mm v] ▶
reset timer
turn [right v] for (90) degrees ▶
print [Turn right took] on screen ◀ and set cursor to next row
print (timer in seconds) on screen ▶
print [seconds] on screen ▶
temporizador en segundos#
The timer in seconds reporter block reports the time since the timer was last reset, as a decimal in seconds. The timer is automatically reset at the start of a project. This block can be used to time how long it takes the robot to complete different actions.
(timer in seconds)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
when started
[Display the time after 2 seconds have passed.]
wait until < (timer in seconds) [math_greater_than_or_equal_to v] [2] >
print (timer in seconds) on screen ▶
cuando el temporizador#
The when timer hat block runs the attached stack of blocks after a specified amount of time.
when timer > [1] seconds
Parámetros |
Descripción |
|---|---|
tiempo |
Especifica el número de segundos antes de que comience la pila de bloques adjunta. Acepta números enteros y decimales. |
Ejemplo
when timer > [2] seconds
[Play a fail sound after 2 seconds.]
play sound [fail v] ▶