Eventos#

Introducción#

An event is a starting signal for a set of blocks. Events blocks in VEXcode EXP 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.

cuando comenzó#

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.

El bloque del sombrero de When started.#
cuando empezó

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

cuando empezó
[Turn around at the start of the project.]
girar hacia el rumbo [180] grados ▶

cuando recibo el evento#

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

El bloque de sombrero de evento Cuando recibo.#
cuando recibo [my_event v]

Parámetros

Descripción

evento

El evento que se va a activar. Los usuarios pueden seleccionar un evento existente, crear uno nuevo, cambiar el nombre del evento seleccionado o eliminarlo.

Ejemplo

cuando empezó
[Display a message and turn at the same time when the screen is pressed.]
esperar hasta <¿pantalla presionada?>
transmisión [turn v]
cuando recibo [turn v]
imprimir [Received!] en la pantalla ▶
girar [derecha v] por [90] grado ▶

evento de transmisión#

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.

El bloque de pila de eventos de difusión.#
transmisión [message1 v]

Parámetros

Descripción

evento

El evento que se va a activar. Los usuarios pueden seleccionar un evento existente, crear uno nuevo, cambiar el nombre del evento seleccionado o eliminarlo.

Ejemplo

cuando empezó
[Turn left when the screen is pressed.]
para siempre
si <¿pantalla presionada?> entonces
transmisión [screen_press v]
demás
turno [derecha v]
cuando recibo [screen_press v]
turno [izquierda v]

evento de transmisión y espera#

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.

El evento de difusión y el bloque de pila de espera.#
transmitir [message1 v] y esperar

Parámetros

Descripción

evento

El evento que se va a activar. Los usuarios pueden seleccionar un evento existente, crear uno nuevo, cambiar el nombre del evento seleccionado o eliminarlo.

Ejemplo

cuando empezó
[Move after the Brain's screen is pressed.]
esperar hasta <¿pantalla presionada?>
transmitir [forward_and_turn v] y esperar
imprimir [Movement done.] en la pantalla ▶
cuando recibo [forward_and_turn v]
unidad [adelante v] para [100] [mm v] ▶
girar [derecha v] por [90] grado ▶