计时器#
介绍#
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 how long something takes, trigger events after a set time, or reset for new timing operations.
以下是所有模块的列表:
重置计时器 — 将计时器重置为零。
timer in seconds — Reports how much time has passed.
当定时器 — 在定时器超过指定时间后运行一个代码块栈。
重置定时器#
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.
重置计时器
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始 :: hat events
[Build Used: Super Code Base 2.0]
[Reset the timer when the bumper is pressed.]
永久循环
清除所有行
打印 (计时器秒数) ▶
如果 <[bumper v] 按下了?> 那么
重置计时器 :: custom-orientation
计时器(以秒为单位)#
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.
(计时器秒数)
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始 :: hat events
[Build Used: Super Code Base 2.0]
[Reset the timer when the bumper is pressed.]
永久循环
清除所有行
打印 (计时器秒数) ▶
如果 <[bumper v] 按下了?> 那么
重置计时器 :: custom-orientation
当计时器#
The when timer hat block runs the attached stack of blocks after a specified amount of time.
当计时器> [1] 秒
参数 |
描述 |
|---|---|
时间 |
指定附加的块堆栈启动前的秒数。接受整数和小数。 |
例子
当计时器> [2] 秒 :: hat events
[Build Used: Code Base 2.0]
[Drive forward after 2 seconds.]
驱动 [向前 v] [100] [毫米 v] ▶