Interface library for ST LSM303DLM 3-axis magnetometer/accelerometer
Dependents: AVC_2012 m3pi_Kompass Fish_2014Fall Fish_2014Fall ... more
Diff: LSM303DLM.h
- Revision:
- 1:fc5c9258ec45
- Parent:
- 0:faef9e4c8bea
--- a/LSM303DLM.h Fri Jan 20 23:47:25 2012 +0000 +++ b/LSM303DLM.h Tue Jan 24 16:56:35 2012 +0000 @@ -56,6 +56,23 @@ /** Tilt-compensated compass interface Library for the STMicro LSM303DLm 3-axis magnetometer, 3-axis acceleromter * @author Michael Shimniok http://www.bot-thoughts.com/ + * + * This is an early revision; I've not yet implemented heading calculation and the interface differs from my + * earlier LSM303DLH; I hope to make this library drop in compatible at some point in the future. + * setScale() and setOffset() have no effect at this time. + * + * @code + * #include "mbed.h" + * #include "LSM303DLM.h" + * + * LSM303DLM compass(p28, p27); + * ... + * int a[3], m[3]; + * ... + * compass.readAcc(a); + * compass.readMag(m); + * + * @endcode */ class LSM303DLM { @@ -122,8 +139,8 @@ private: I2C _device; char _data[6]; - /** initializes the device - */ + int offset[3]; + int scale[3]; void init(); };