Minutero#
Introducción#
The VEX V5’s Brain has a timer that 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 disponibles:
reset timer – Restablece 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 excede un tiempo especificado.
reiniciar 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.
reiniciar el temporizador
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Display the time the robot takes to turn right.]
unidad [adelante v] para [200] [mm v] ▶
reiniciar el temporizador
girar [derecha v] por [90] grado ▶
Establezca la precisión de impresión en [0.1 v] en la pantalla
imprimir [Turn right took] en la pantalla ◀ y coloque el cursor en la siguiente fila
imprimir (temporizador en segundos) en la pantalla ▶
imprimir [ seconds] en la pantalla ▶
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.
(temporizador en segundos)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Display the time after 2 seconds have passed.]
esperar hasta <(temporizador en segundos) [math_greater_than_or_equal_to v] [2]>
imprimir (temporizador en segundos) en la pantalla ▶
cuando el temporizador#
The when timer hat block runs the attached stack of blocks after a specified amount of time.
cuando el temporizador > [1] segundos
Parámetros |
Descripción |
|---|---|
tiempo |
Especifica el número de segundos que deben transcurrir hasta que se inicia la pila de bloques adjunta. Acepta números enteros y decimales. |
Ejemplo
cuando el temporizador > [2] segundos
[Display a message after 2 seconds.]
imprimir [Time's up!] en la pantalla ▶