Timer#

Introduction#

The VEX GO’s Brain has a timer that keeps track of elapsed time from the start of a project. It can be used to measure durations, trigger events after a set time, or reset for new timing operations.

Below is a list of all available blocks:

  • reset timer – Resets the timer to zero.

  • timer in seconds – Returns the current elapsed time in seconds.

  • when timer – Runs a stack of blocks after the timer exceeds a specified time.

reset timer#

The reset timer block resets the timer to zero.

The reset timer stack block.#
  reset timer

Parameters

Description

This block has no parameters.

Example

aria-description goes here#
  when started :: hat events
  [Build Used: Super Code Base 2.0]
  [Reset the timer when the bumper is pressed.]
  forever
  clear all rows
  print (timer in seconds) ▶
  if <[bumper v] pressed?> then
  reset timer :: custom-orientation

timer in seconds#

The timer in seconds block returns the elapsed time since the timer was last reset, as a decimal in seconds.

The timer in seconds reporter block.#
  (timer in seconds)

Parameters

Description

This block has no parameters.

Example

aria-description goes here#
  when started :: hat events
  [Build Used: Super Code Base 2.0]
  [Reset the timer when the bumper is pressed.]
  forever
  clear all rows
  print (timer in seconds) ▶
  if <[bumper v] pressed?> then
  reset timer :: custom-orientation

when timer#

The when timer block activates the attached stack of blocks after a specified amount of time.

The when timer hat block.#
  when timer > [1] seconds

Parameters

Description

time

Specifies the number of seconds before the attached stack of blocks starts. Accepts both whole and decimal numbers.

Example

aria-description goes here#
  when timer > [2] seconds :: hat events
  [Build Used: Code Base 2.0]
  [Drive forward after 2 seconds.]
  drive [forward v] for [100] [mm v] ▶