Gyroscope
R2026bRepresent connected gyroscope and measure yaw angle
Libraries:
Simulink Coder Support Package for VEX EDR V5 Robot Brain /
Sensors
Description
Add-On Required: This feature requires the Simulink Coder Support Package for VEX EDR V5 Robot Brain add-on.
The Gyroscope block represents a gyroscope connected to the 3-wire port of VEX V5 Robot brain, and measures the angle (in degrees) along the yaw axis of the gyroscope sensor.
The block outputs angle in degrees as a double-precision scalar value. When you rotate the gyroscope sensor in a clockwise direction, the angular increases. When you rotate the sensor in a counterclockwise direction, the value decreases.

While starting the program, do not move the robot for a couple of seconds for proper initialization of Gyroscope.
Ports
Output
Parameters
Programmatic Use: Add Block
To add the block programmatically, use the add_block function with one of these library block paths as the source.
"vexv5lib/Sensors/Gyroscope"
Example: add_block("vexv5lib/Sensors/Gyroscope","myModel/myBlock",MakeNameUnique="on")
Extended Capabilities
Version History
Introduced in R2019b

