The VEX GO Brain is used to detect acceleration and rotation.
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.
The Brain can detect:
The Brain can report acceleration of each of the three axes using the (Acceleration of) block.
The Brain reports acceleration on three axes. The x, y, and z-axis. Each axis has a positive and negative direction.
Heading and Rotation.
The Brain can report the heading value in degrees using the (Drive heading) block.
The heading value reports a range from 0-359.99 degrees. The value is reported from a clockwise turn.
The Brain can report the rotation value in degrees using the (Drive rotation) block.
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.
Report Acceleration Example Project
The code below will report the acceleration value of each axis as the Code Base is rotated.
The Print Console can be used to see the acceleration value changing in real time.
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.
The Print Console can be used to see the heading and rotation values changing in real time.
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.
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.