The gyroscopic sensor measures rotation around a single vertical axis that extends from the top and bottom of the EV3 Gyro Sensor (item number 45505).
To connect from the MATLAB software to the gyro sensor, use the
gyroSensor function to create a
To measure the total rotation of the sensor in degrees, use the
readRotationAnglefunction with the
gyroSensorobject. Rotating the sensor clockwise increases the value. Rotating the sensor counterclockwise decreases the value. For example, if you rotate the sensor 360 degrees clockwise and 60 degrees counterclockwise, the measurement value is 300.
To measure the sensor’s rate of rotation in degrees per second, use the
readRotationRatefunction with the
gyroSensorobject. Rotating the sensor clockwise produces positive values. Rotating the sensor counterclockwise produces negative values. For example, if you rotate the sensor counterclockwise one full rotation (360 degrees) every 10 seconds, the rate of rotation is -36 degrees per second.