Gyro#

Introduction#

The VEX 123 Robot includes a built-in gyroscope for detecting crashes and measuring acceleration.

Below is a list of all available blocks:

  • detected crash? – Returns a Boolean indicating whether or not a crash was detected.

  • acceleration – Returns the linear acceleration along the x, y, or z axis.

detected crash?#

The detected crash? block returns a Boolean indicating if the robot has come in contact with a wall or other object.

  • True - A crash was detected.

  • False - A crash was not detected.

  <detected crash?>

Parameters

Description

This block has no parameters.

Example

  when started
  [Back up after a crash.]
  drive [forward v]
  wait until <detected crash?>
  drive [reverse v] for (200) [mm v]

acceleration#

The acceleration block returns the acceleration value from one of the axes (x, y, or z) of the 123 Robot’s Gyro Sensor from -4.0 to 4.0 Gs.

  (acceleration of [x v] axis in g)

Parameters

Description

axis

The axis to return the acceleration of:

  • x
  • y
  • z