Arduino AHRS for LSM9DS0 using Madgwick/Mohony filter
C++ C Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples/LSM9SDS0_AHRS_Abstracted
.gitignore
LSM9DS0_AHRS.cpp
LSM9DS0_AHRS.h
README.md

README.md

LSM9DS0 AHRS Driver for Arduino

by Nicholas Robinson

Overview

An AHRS driver leveraging the LSM9DS0 library and AHRS example code from sparkfun (https://github.com/sparkfun/LSM9DS0_Breakout).

The LSM9DS0 iNEMO inertial module features a 3D digital linear acceleration sensor, and a 3D digital angular rate sensor, a 3D digital magnetic sensor. This driver allows simple access to AHRS yaw, pitch and roll calculated using Sebastian Madgwick and Robert Mayhony’s orientation filters.

Usage

#include <SFE_LSM9DS0.h>
#include <LSM9DS0_AHRS.h>

LSM9DS0_AHRS* ahrs;

void setup()
{ 
  ahrs = new LSM9DS0_AHRS(MADGWICK);
  // Can also be invoked:
  // ahrs = new LSM9DS0_AHRS(MAHONY);
}

void loop()
{ 
  ahrs->update();
  
  // YOUR_STUFF
  // raw, pitch and roll available with:
  // ahrs->yaw, ahrs->pitch and ahrs->roll
}

Requirements

Tested On

Arduino R3 (https://www.sparkfun.com/products/11021), with: