Data Sheet

Core Spartan Documentation Modern Robotics, Inc
Version 3.0.3 Page 43
void tiltUp(void)
This function calculates an offset to compensate for the magnetic field not being
perfectly horizontal. The sensor must be held 20° above the horizon during
calibration.
COMP.tiltUp
void tiltDown(void)
This function calculates an offset to compensate for the magnetic field not being
perfectly horizontal. The sensor must be held 20° below the horizon during
calibration.
COMP.tiltDown();
int getMagnetometer(char axis);
This function returns the values of the magnetometer on the X, Y and Z axis.
int value;
value = COMP.getMagnetometer();
…or…
Serial.print(COMP.getMagnetometer());
void scaleAccelerometer(void);
This function is called if the user wants to change the sensitivity of the
accelerometer reading. First the sensor must be set vertical (Same position as Z
calibration) and hold it there for the duration of the calibration. Once the sensor
is in position the function may be called and the scaling calibration while be
completed.
COMP.scaleAccelerometer ();