Skip to content

Instantly share code, notes, and snippets.

@ViennaMike
ViennaMike / compass_calibrate.py
Created April 29, 2018 20:29
Calibration Program for LMS303 3-axis accelerometer and magnetometer, Written in python 2.7. Uses adafruit_lsm303.mpy module to interface with the sensot.
# Simple calibration program using the LSM303 accelerometer & magnetometer library.
# Will print the max accelerometer & magnetometer X, Y, Z axis values every
# 1/10th of a second.
# Author: Mike McGurrin, combining code from Tony DiCola and Pololu,
# with additional concepts from https://appelsiini.net/2018/calibrate-magnetometer/
# License: Follows Pololu license (other code was public domain):
# Portions Copyright (c) 2013 Pololu Corporation. For more information, see
#http://www.pololu.com/
#http://forum.pololu.com/