lsm303: rename to lsm303dlh

There are a variety of LSM303 devices out there with various
incompatibilities and differing capabilities.  The current lsm303
driver in UPM only supports the LSM303DLH variant, so it has been
renamed to lsm303dlh to avoid confusion and to make it clear which
variant is actually supported.

All examples and source files have been renamed, including header
files.  In addition, the class name, LSM303, has been renamed to
LSM303DLH.  No other functionality or behavior has been changed.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson
2017-04-12 11:49:20 -06:00
parent d9fd1af272
commit 19c58ebba2
13 changed files with 95 additions and 82 deletions

View File

@ -25,19 +25,19 @@
#include <iostream>
//! [Interesting]
#include "lsm303.hpp"
#include "lsm303dlh.hpp"
int
main(int argc, char **argv)
{
// Instantiate LSM303 compass on I2C
upm::LSM303 *sensor = new upm::LSM303(0);
// Instantiate LSM303DLH compass on I2C
upm::LSM303DLH *sensor = new upm::LSM303DLH(0);
// Get the coordinate data
sensor->getCoordinates();
int16_t* coor = sensor->getRawCoorData(); // in XYZ order.
int16_t* coor = sensor->getRawCoorData(); // in XYZ order.
// The sensor returns XZY, but the driver compensates and makes it XYZ
// Print out the X, Y, and Z coordinate data using two different methods
std::cout << "coor: rX " << (int)coor[0]
<< " - rY " << (int)coor[1]