Coding with the VEX GO Brain

The VEX GO Brain is used to detect acceleration and rotation.

GO_Brain-Battery.png

The following article will cover:

  • How the Brain is Used
  • Report Acceleration Example Project
  • Report Heading and Rotation Example Project

Note: in this article, the example projects use the Code Base GO Build.


How the Brain is Used

The Brain has a built in Gyro and Accelerometer. These are used to detect acceleration and rotation.

GO_Brain-Powered_On.png

The Brain can detect:

Acceleration.
The Brain can report acceleration of each of the three axes using the (Acceleration of) block.

_Acceleration_of__block.png

The Brain reports acceleration on three axes. The x, y, and z-axis. Each axis has a positive and negative direction.

GO_BrainAxis.png

Heading and Rotation.

The Brain can report the heading value in degrees using the (Drive heading) block.

_Drive_heading__block.png

The heading value reports a range from 0-359.99 degrees. The value is reported from a clockwise turn.

GO_Brain_Compass.jpg

The Brain can report the rotation value in degrees using the (Drive rotation) block.

_Drive_rotation__block.png

The rotation value reports positive values when rotated to the right, and negative values when rotated to the left. Rotation values are cumulative, and are not capped at 0 or 360 degrees. They will continue to increase or decrease as the rotations accumulate.

GO_Brain_Rotation_Direction.png


Report Acceleration Example Project

The code below will report the acceleration value of each axis as the Code Base is rotated.

Report_acceleration_snipit.png

The Print Console can be used to see the acceleration value changing in real time.

Report_acceleration_project_markup.jpeg


Report Heading and Rotation Example Project

The code below will report the heading of the Code Base’s Drivetrain and the rotation value as the Code Base turns.

Report_rotation_snipit.png

The Print Console can be used to see the heading and rotation values changing in real time.

Report_Heading_and_Rotation__right__mockup.jpeg

Notice that the heading values are reported clockwise between 0-359.99 degrees, because the Code Base is turning right. Rotation values are cumulative, they will continue to increase (right rotation) or decrease (left rotation).

Adjust the [Turn for] block in the project to change the direction from ‘right’ to ‘left’ and Start the project again.

Report_Rotation_left_snipit.png

In the Print Console, notice that the heading values are reported clockwise between 0-359.99 degrees, because the Code Base is turning left. The first turn left 90 degrees is reported as a heading of 270 degrees. The rotation values continue to increase with each rotation, however, since the Code Base is turning left, the rotation values are reporting negative.

Report_Heading_and_Rotation__left__mockup.jpeg