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.

<检测到碰撞?>

Parameters

Description

This block has no parameters.

Example

当开始
[Back up after a crash.]
驱动 [向前 v]
等到 <检测到碰撞?>
驱动 [反 v] (200) [毫米 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.

([X v] 轴加速度值\(g\))

Parameters

Description

axis

The axis to return the acceleration of:

  • x
  • y
  • z