Skip to content

Instantly share code, notes, and snippets.

@esnho
esnho / lsm303agr-compas.ino
Created June 24, 2024 06:51 — forked from CalebFenton/lsm303agr-compas.ino
LSM303AGR Compass Example with calibration and z-axis
/*
* LSM303AGR Compass Example
*
* From what I can gather, this shows the proper way to get a compas heading from the LSM303.
* It solves two problems which aren't addressed in the Adafruit example code:
* 1.) Show how to incorporate min and max values from calibration. Makes a HUGE difference in my testing.
* 2.) Take the z-axis into account.
*
* Based heavily off Adafruit example code and https://github.com/pololu/lsm303-arduino.
*/