活动#

介绍#

An event is a starting signal for a set of blocks. Events blocks in VEXcode GO let different sets of blocks begin at different times. For example, one set of blocks can start when the project begins, and another can start when a signal is sent from somewhere else in the project.

以下是所有模块的列表:

何时开始#

The when started hat block starts running the blocks below it when the project begins. Every project needs at least one when started block — without it, the blocks below it will not run. Multiple when started blocks can be used to run different sets of blocks at the same time.

何时开始帽子块。#
当开始

参数

描述

该块没有参数。

例子

当开始 :: hat events
[Build Used: Code Base 2.0]
[Drive forward then stop.]
驱动 [向前 v]
等待 (2) 秒
驱动停止

当我收到事件#

The when I receive event hat block starts running the blocks below it when a signal with the same event name is broadcast.

当我收到事件帽子块时。#
当我收到 [my_event v]

参数

描述

事件

要触发的事件。用户可以选择现有事件、创建新事件、重命名所选事件或删除它。

例子

当开始 :: hat events
[Build Used: Super Code Base 2.0]
[Turn LED Bumper green while the robot moves.]
广播 [square_drive v]
设定 [bumper v] 为 [绿色 v]
当我收到 [square_drive v] :: hat events
[Move in a square pattern.]
重复 [4]
驱动 [向前 v] [100] [毫米 v] ▶
[右 v] 转 [90] 度 ▶

广播事件#

The broadcast event stack block sends a signal that starts any when I receive event block with the same event name. The rest of the blocks in the project keep running without waiting for those blocks to finish.

广播事件堆栈块。#
广播 [message1 v]

参数

描述

事件

要触发的事件。用户可以选择现有事件、创建新事件、重命名所选事件或删除它。

例子

当开始 :: hat events
[Build Used: Super Code Base 2.0]
[Turn LED Bumper green while the robot moves.]
广播 [square_drive v]
设定 [bumper v] 为 [绿色 v]
当我收到 [square_drive v] :: hat events
[Move in a square pattern.]
重复 [4]
驱动 [向前 v] [100] [毫米 v] ▶
[右 v] 转 [90] 度 ▶

广播事件并等待#

The broadcast event and wait stack block sends a signal that starts any when I receive event block with the same event name. The rest of the project will wait for the broadcasted event to finish running.

广播事件和等待堆栈块。#
广播 [message1 v] 并等待

参数

描述

事件

要触发的事件。用户可以选择现有事件、创建新事件、重命名所选事件或删除它。

例子

当开始 :: hat events
[Build Used: Super Code Base 2.0]
[Turn LED Bumper green after robot is done moving.]
广播 [square_drive v] 并等待
设定 [bumper v] 为 [绿色 v]
当我收到 [square_drive v] :: hat events
[Move in a square pattern.]
重复 [4]
驱动 [向前 v] [100] [毫米 v] ▶
[右 v] 转 [90] 度 ▶