Library to read data from a CMPS10 tilt-compensating compass with an Arduino.
Clone this repository
$ git clone https://github.com/kragniz/CMPS10.git
Copy the files into the Arduino library directory
$ cp -r CMPS10 ~/sketchbook/libraries/CMPS10
Then restart the Arduino IDE.
To use this library, include the header file:
#include <CMPS10.h>Then create an instance of the compass
CMPS10 my_compass;You can now access the bearing of the compass with
my_compass.bearing();Return the bearing in degrees as a float, 0-359.9:
float bearing()Return the bearing as a byte, 0-255:
int bearing_byte()int8_t pitch()
int8_t roll()Return the overall acceleration on the accelerometer, measured in units of g.
float acceleration()Return the acceleration in each of the three axis.
float acceleration_x()
float acceleration_y()
float acceleration_z()This code is released under the terms of the LGPLv3 license. See COPYING for
more details.
