MAG3110 library with calibrate operation included
Dependents: FRDM-KL46-Template AxedaGo-Freescal_FRDM-KL46Z revert AxedaGo-Freescal_FRDM-KL46Z HC-05_S2B_HelloWorld_WIZwiki-W7500_sensores
Fork of MAG3110 by
Diff: MAG3110.h
- Revision:
- 4:cf40601402b7
- Parent:
- 3:bc784c24f3b2
- Child:
- 5:f510561f6107
diff -r bc784c24f3b2 -r cf40601402b7 MAG3110.h --- a/MAG3110.h Fri May 24 20:11:50 2013 +0000 +++ b/MAG3110.h Fri May 24 20:16:24 2013 +0000 @@ -81,18 +81,18 @@ { public: /** - * MAG3110 constructor + * Main constructor * @param sda SDA pin * @param sdl SCL pin * @param addr addr of the I2C peripheral */ MAG3110(PinName sda, PinName scl); /** - * MAG3110 constructor + * Debug version of constructor * @param sda SDA pin * @param sdl SCL pin - * @param addr addr of the I2C peripheral - * @param pc serial port object to output debug messages + * @param addr Address of the I2C peripheral + * @param pc Serial object to output debug messages */ MAG3110(PinName sda, PinName scl, Serial *pc); //pass serial for debug /** @@ -134,8 +134,8 @@ void setCalibration(int minX, int maxX, int minY, int maxY); private: + I2C _i2c; int _i2c_address; - I2C _i2c; Serial *_pc; bool _debug; int _avgX, _avgY;