Transmisión#

Introducció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.

There are many ways to code the drivetrain. Below is a list of all Drivetrain blocks:

Acciones: Mover y girar el robot.

  • drive — Moves the robot forward or reverse forever.

  • drive for — Moves the robot forward or reverse for a specific distance.

  • drive until — Moves the robot forward or reverse until it detects an object, crash, or line.

  • 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.

Settings — Adjust drivetrain settings.

Values — Check movement status.

  • drive is done — Reports whether the robot is finished moving.

  • drive heading — Reports the robot’s current heading from 0 to 359 degrees.

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 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]

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:

  • object — The Eye Sensor detects an object.
  • crash — The robot crashes into an object.
  • line — The Line Detector detects a line under the robot.

Ejemplo

cuando empezó
[Reverse after a crash.]
Conducir [adelante v] al [choque v]
conducir [atrás v] por (1) [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 al rumbo#

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

deja 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 el 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 el rumbo de la unidad#

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 0 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]

rumbo de la unidad#

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) ▶