Data Sheet
Core Spartan Documentation Modern Robotics, Inc
Version 3.0.3 Page 46
int getAxis(char axis)
This function returns the rate of rotation for a particular axis in degrees.
X = X Axis
Y = Y Axis
Z = Z Axis
int value;
value = GYRO.getAxis(X);
…or…
Serial.print(GYRO.getAxis(Z));
void setScale(float scale_value)
This function allows for scaling on the Z axis. The z axis scaling coefficient is a 16
bit value meant to scale the heading reading so that more precise measurements
can be made.
The formula for calculating the Z axis scaling coefficient (scale_value):
Therefore if an Integrating Gyro rotates 360° but the returned heading values
read 380°, (20° if reading in degree mode) which is 20° over what was expected,
then the formula above can be used to scale the reading.
scale_value = Angle Rotated / Heading Value
scale_value = 360 / 380
scale_value = .947
Then the setScale() function can be called with the scale_value that was found
during calculations.
GYRO.setScale(.947);
Once the value is set using this function, it will be saved in EEPROM. Therefore it
only needs to be called once to be set and the only way to change the value it to
call the function again.










