Gyro#

Introduction#

The VEX 123 Robot includes a built-in Gyro Sensor. In these blocks, the Gyro Sensor is used to detect sudden impacts and report acceleration along the x, y, and z axes.

Below is a list of all available blocks:

  • detected crash – Reports whether the 123 Robot has detected a sudden impact.

  • acceleration – Reports how quickly the 123 Robot is speeding up or slowing down on the selected axis.

detected crash?#

The detected crash Boolean block reports whether the 123 Robot has detected a sudden impact, such as hitting an object or being bumped hard enough to quickly change its motion.

  • True — A crash has been detected.

  • False — A crash has not been 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#

Acceleration is how quickly the robot is speeding up or slowing down. The acceleration reporter block reports the acceleration of the 123 Robot on the selected axis, from -4.0 G to 4.0 G.

A G is a unit used to measure acceleration. 1 G is about the acceleration you feel from gravity while sitting still.

The value can be positive or negative depending on the direction of acceleration on the selected axis. The selected axis tells which direction of motion the block reports.

  (acceleration of [x v] axis in g)

Parameters

Description

axis

The axis to measure acceleration on:

  • x
  • y
  • z