计时器#
介绍#
The VEX AIR Drone Controller’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.
以下是所有可用块的列表:
重置计时器——将计时器重置为零。
timer in seconds — Reports how much time has passed.
when timer — 计时器超过指定时间后运行一堆块。
重置定时器#
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.
重置计时器
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始
[Display the time the drone takes to climb upwards.]
起飞至 [500] [毫米 v] ▶
重置计时器
爬升 [向上 v] 获得 [500] [毫米 v] ▶
在屏幕上打印 [Time elapsed:]▶
在屏幕上打印 (计时器秒数)▶
计时器(以秒为单位)#
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 drone to complete different actions.
(计时器秒数)
参数 |
描述 |
|---|---|
该块没有参数。 |
例子
当开始
[Play a sound after 4 seconds.]
等到 <(计时器秒数) [math_greater_than_or_equal_to v] [4]>
在屏幕上打印 (计时器秒数)▶
播放声音 [成功 v] ▶
当计时器#
The when timer hat block runs the attached stack of blocks after a specified amount of time.
当计时器> [1] 秒
参数 |
描述 |
|---|---|
时间 |
指定附加块堆栈启动前的秒数。接受整数和小数。 |
例子
当计时器> [4] 秒
[Play a sound after 4 seconds.]
在屏幕上打印 (计时器秒数)▶
播放声音 [成功 v] ▶