HMC58X3 Library
Fork of HMC58X3 by
Diff: HMC58X3.h
- Revision:
- 2:c5ac16c88514
- Parent:
- 1:72ecf7399250
- Child:
- 3:1e0e0c47287a
--- a/HMC58X3.h Mon Jun 24 19:44:55 2013 +0000 +++ b/HMC58X3.h Sat Nov 02 17:23:23 2013 +0000 @@ -79,20 +79,24 @@ #define HMC58X3_R_IDB 11 #define HMC58X3_R_IDC 12 +#define I2C_SDA p28 +#define I2C_SCL p27 + class HMC58X3 { public: //HMC58X3(PinName sda, PinName scl); + HMC58X3(); HMC58X3(I2C i2c_); void init(bool setmode); void init(int address, bool setmode); - void getValues(int *x,int *y,int *z); + void getValues(int16_t *x,int16_t *y,int16_t *z); void getValues(float *x,float *y,float *z); void getValues(float *xyz); - void getRaw(int *x,int *y,int *z); - void getRaw(int *xyz); + void getRaw(int16_t *x,int16_t *y,int16_t *z); + void getRaw(int16_t *xyz); void calibrate(unsigned char gain); // Original calibrate with a few weaknesses. bool calibrate(unsigned char gain,unsigned int n_samples); void setMode(unsigned char mode);