Bloques específicos para robots#
Introducción#
The 123 Robot includes a Drivetrain, LED, speaker, Eye Sensor, and Gyro Sensor.
All standard VEXcode VR Blocks are available for use in the 123 Playspace Playground.
Below is a list of all available Robot-specific Blocks:
Sistema de transmisión: Mover y girar el robot.
Comportamiento
drive - Moves the robot forward or reverse forever.
drive until - Moves the robot forward or reverse until it detects an object, crash, or line.
drive for - Moves the robot forward or reverse for a specific distance.
turn - Turns the robot left or right forever.
turn for - Turns the robot left or right for a specific number of degrees.
turn to heading - Turns the robot to face a specific heading from -359 to 359 degrees. The robot will turn the shortest direction to reach the target heading.
stop driving - Stops the robot’s movement.
Ajustes
set drive timeout - Sets how many seconds the robot will try to finish a movement.
set drive heading - Changes the robot’s current heading to a new heading.
Valores
drive is done - Reports whether the robot is finished moving.
drive heading - Reports the robot’s current heading from 0 to 359 degrees.
Sonido: Reproduce los sonidos integrados a través del altavoz del robot 123.
reproducir sonido - Reproduce uno de los efectos de sonido incorporados del robot.
LED - Controla el LED central del robot 123.
brillo - Establece el color de la luz LED.
Acciones: Haz que el robot 123 realice comportamientos preestablecidos.
actuar - Representa diferentes emociones.
Detección: Lee los valores de los sensores del robot 123.
Giroscopio
detected crash — Reports whether the robot has detected a sudden impact.
Ojo
eye found an object – Reports whether or not the Eye Sensor detects an object within range.
eye detects color – Reports whether the Eye Sensor detects a specified color.
eye hue – Reports the hue detected by the Eye Sensor.
eye bright object – Reports whether the detected object reflects a lot of light.
eye brightness – Reports the brightness detected by the Eye Sensor.
Tren de transmisión#
The 123 Robot has a two-wheel drivetrain that lets it drive and turn. The Drivetrain blocks control how the robot moves.
The drivetrain can measure distance in two ways: steps and mm (millimeters). One step is one square on a 123 Field.
Comportamiento#
conducir#
The drive stack block moves the robot forward or reverse forever. The robot will continue to move until it is given another action, like turning or stopping.
unidad [adelante v]
Parámetros |
Descripción |
|---|---|
dirección |
The direction the robot moves: forward or reverse. |
Ejemplo
cuando empezó
[Drive for 2 seconds.]
unidad [adelante v]
esperar (2) segundos
deja de conducir
conducir hasta#
The drive until stack block moves the robot forward or reverse until the Eye Sensor detects an object, crash, or line.
Conducir [adelante v] al [objeto v]
Parámetros |
Descripción |
|---|---|
dirección |
The direction the robot moves: forward or reverse. |
condición |
The condition that stops the robot:
|
Ejemplo
cuando empezó
[Reverse after a crash.]
Conducir [adelante v] al [choque v]
conducir [atrás v] por (1) [pasos v]
impulso para#
The drive for stack block moves the robot forward or reverse for a specific distance. The project will wait until the robot is done moving before the next block in the stack runs.
conducir [adelante v] por (1) [pasos v]
Parámetros |
Descripción |
|---|---|
dirección |
The direction the robot moves: forward or reverse. |
distancia |
The distance the robot drives. This can be an integer or a decimal. |
unidad |
The distance unit: steps or mm. |
Ejemplo
cuando empezó
[Drive back and forth.]
conducir [adelante v] por (3) [pasos v]
conducir [atrás v] por (3) [pasos v]
doblar#
The turn stack block turns the robot left or right forever. The robot will continue to turn until it is given another action, like driving or stopping.
turno [derecha v]
Parámetros |
Descripción |
|---|---|
dirección |
The direction the robot turns: left or right. |
Ejemplo
cuando empezó
[Turn for 2 seconds.]
turno [derecha v]
esperar (2) segundos
deja de conducir
girar para#
The turn for stack block turns the robot left or right for a specific number of degrees. The turn is relative to the current position of the robot. The project will wait until the robot is done turning before the next block in the stack runs.
girar [derecha v] por (90) grado
Parámetros |
Descripción |
|---|---|
dirección |
The direction the robot turns: left or right. |
ángulo |
The number of degrees the robot turns. This can be an integer or a decimal. |
Ejemplo
cuando empezó
[Turn left, then turn around to the right.]
girar [izquierda v] por (90) grado
girar [derecha v] por (180) grado
girar hacia el encabezamiento#
A heading is the direction the robot is facing, measured in degrees. The turn to heading stack block turns the robot to face a specific heading from -359 to 359 degrees. The robot will turn the shortest direction to reach the target heading.
The robot’s starting heading is 0 degrees.
girar hacia el rumbo (90) grados
Parámetros |
Descripción |
|---|---|
título |
The direction the robot should face, in degrees. This can be an integer or a decimal from -359 to 359. |
Ejemplo
cuando empezó
[Turn to face the cardinal directions.]
girar hacia el rumbo (90) grados
esperar (2) segundos
girar hacia el rumbo (180) grados
esperar (2) segundos
girar hacia el rumbo (270) grados
esperar (2) segundos
girar hacia el rumbo (0) grados
esperar (2) segundos
dejar de conducir#
The stop driving stack block stops the robot’s movement.
deja de conducir
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Stop driving after 4 seconds.]
unidad [adelante v]
esperar [4] segundos
deja de conducir
Ajustes#
establecer tiempo de espera de la unidad#
The set drive timeout stack block sets how many seconds the robot will try to finish a movement. If the robot cannot finish in that time, it will stop trying and move on to the next block in the stack. This keeps the robot from getting stuck on a movement.
Establezca el tiempo de espera de la unidad en (1) segundos
Parámetros |
Descripción |
|---|---|
tiempo |
The number of seconds the robot can try to finish a movement. This can be a whole number or a decimal. |
Ejemplo
cuando empezó
[Turn right after driving for 1 second.]
Establezca el tiempo de espera de la unidad en (1) segundos
conducir [adelante v] por (1000) [mm v]
girar [derecha v] por (90) grado
establecer dirección de conducción#
A heading is the direction the robot is facing, measured in degrees. The set drive heading stack block changes the robot’s current heading to a new heading value.
For example, if the robot has turned to face right, setting the heading to 0 degrees makes that right-facing position the new 0 degrees. Then the robot can turn to other positions based on that new heading.
establecer el rumbo de la unidad a (0) grados
Parámetros |
Descripción |
|---|---|
título |
The heading value, in degrees, to set for the robot. This can be an integer or a decimal from -359 to 359. |
Ejemplo
cuando empezó
[Face the new 0 degree heading.]
establecer el rumbo de la unidad a (90) grados
girar hacia el rumbo (0) grados
Valores#
drive is done#
The drive is done Boolean block reports whether the robot is finished moving. This can be used to control the timing of other behaviors based on the robot’s movement.
True — The robot is finished moving.
False — The robot is still moving.
This block works together with the following Drivetrain blocks: drive for, drive until, turn for, and turn to heading.
<¿La unidad está lista?>
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Glow blue after a crash.]
Conducir [adelante v] al [choque v]
para siempre
si <¿La unidad está lista?> entonces
resplandor [azul v]
demás
resplandor [verde v]
dirección de conducción#
A heading is the direction the robot is facing, measured in degrees. The drive heading reporter block reports the robot’s current heading from 0 to 359 degrees.
The robot’s starting heading is 0 degrees.
(rumbo de la unidad en grados)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Display the heading after turning.]
girar [derecha v] por (450) grado
imprimir (rumbo de la unidad en grados) ▶
Sonido#
reproducir sonido#
El bloque reproducir sonido reproduce uno de los sonidos incorporados del robot.
reproducir sonido [bocinazo v]
Parámetros |
Descripción |
|---|---|
sonido |
Uno de los sonidos integrados que se muestran a continuación. |
Nombre del sonido |
Reproducir sonido |
|---|---|
bocinazo |
|
timbre de la puerta |
|
chocar |
|
aleatorio |
Reproduce un sonido aleatorio de entre los 3 sonidos anteriores. |
Ejemplo
cuando empezó :: hat events
[Play the doorbell sound.]
reproducir sonido [timbre de la puerta v]
CONDUJO#
brillo#
El bloque brillante determina el color de la luz LED.
resplandor [verde v]
Parámetros |
Descripción |
|---|---|
color |
Color para configurar el LED:
|
Ejemplo
cuando empezó :: hat events
[Blink the LED light forever.]
para siempre
resplandor [verde v]
esperar [0.5] segundos
resplandor [apagado v]
esperar [0.5] segundos
Comportamiento#
acto#
El bloque act se utiliza para simular tristeza, alegría o locura haciendo que el robot 123 realice una secuencia de acciones de conducción, giro y emisión de sonidos.
acto [triste v]
Parámetros |
Descripción |
|---|---|
emoción |
La emoción a representar.
|
cuando empezó :: hat events
[Act out a happy behavior.]
acto [feliz v]
Detección#
El robot virtual 123 también tiene acceso a los bloques de detección estándar Cerebro y Tren motriz.
Giroscopio#
The 123 Robot uses gyro sensing to detect sudden impacts, such as hitting a wall or object.
detected crash#
The detected crash Boolean block reports whether the robot has detected a sudden impact, such as hitting a wall or object hard enough to quickly change its motion.
True — A crash has been detected.
False — A crash has not been detected.
<¿Se detectó un accidente?>
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Back up after a crash.]
unidad [adelante v]
esperar hasta <¿Se detectó un accidente?>
conducir [atrás v] por (200) [mm v]
Ojo#
eye found an object#
The eye found an object Boolean block reports whether or not the Eye Sensor detects an object within range.
True — The Eye Sensor detects an object.
False — The Eye Sensor does not detect an object.
<¿El ojo encontró un objeto?>
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Stop driving after detecting an object.]
establecer luz de ojo [encendido v]
unidad [adelante v]
esperar (0.1) segundos
esperar hasta <¿El ojo encontró un objeto?>
deja de conducir
eye detects color#
The eye detects color Boolean block reports whether the Eye Sensor detects a specified color, based on the detected hue value.
True – The Eye sensor detects the specified color.
False – The Eye sensor does not detect the specified color.
To check the exact hue value detected by the Eye Sensor, use the eye hue reporter block.
<¿El ojo detecta [rojo v]?>
Parámetros |
Descripción |
|---|---|
color |
The color to detect:
|
Ejemplo
cuando empezó
[Stop driving after detecting a green object.]
establecer luz de ojo [encendido v]
unidad [adelante v]
esperar (0.1) segundos
esperar hasta <¿El ojo detecta [verde v]?>
deja de conducir
color de ojos#
The eye hue reporter block reports the hue detected by the Eye Sensor as a number from 0 to 359 degrees.
Hue is a way to describe color using numbers around a color wheel.

(tono de ojos en grados)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Display if an object is pink.]
para siempre
borrar todas las filas
si <[290] [math_less_than v] (tono de ojos en grados) [math_less_than v] [350]> entonces
imprimir [Pink!] ▶
esperar (0.1) segundos
demás
imprimir [Not pink!] ▶
esperar (0.1) segundos
eye bright object#
The eye bright object Boolean block reports whether the object detected by the Eye Sensor is bright.
An object is considered bright when it reflects more than 70% brightness back to the Eye Sensor.
True — The detected object reflects more than 70% brightness.
False — The detected object reflects 70% brightness or less.
This can be used before checking for a color to make sure the object is reflecting enough light for the Eye Sensor to detect the color reliably.
<¿ojo objeto brillante?>
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Display whether a detected object is bright.]
Establezca la potencia de la luz ocular al (100)%
unidad [adelante v]
esperar hasta <¿El ojo encontró un objeto?>
esperar (0.1) segundos
si <¿ojo objeto brillante?> entonces
imprimir [Bright object!] ▶
demás
imprimir [Object not bright.] ▶
brillo de los ojos#
The eye brightness reporter block reports how much light is reflected back to the Eye Sensor, as a percentage from 0% to 100%.
A higher percentage means more light is reflected back to the Eye Sensor. A lower percentage means less light is reflected back.
(brillo ocular en %)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Display whether a detected object is bright.]
Establezca la potencia de la luz ocular al (100)%
unidad [adelante v]
esperar hasta <¿El ojo encontró un objeto?>
esperar (0.1) segundos
si <(brillo ocular en %) [math_less_than v] [70]> entonces
imprimir [Object not bright.] ▶
demás
imprimir [Bright object!] ▶