Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: compassDemo weather_station_proj weather_station_project weather_station_proj_v1_2
Diff: HMC5983.h
- Revision:
- 2:4debef04091d
- Parent:
- 1:fb6804e865fd
--- a/HMC5983.h Thu Jul 05 15:43:14 2018 +0000
+++ b/HMC5983.h Thu Jul 05 17:57:00 2018 +0000
@@ -121,18 +121,20 @@
void setSampleAverages(hmc5983_sampleAverages_t sampleAverages);
hmc5983_sampleAverages_t getSampleAverages(void);
- float readHeading();
- void readHeadingVector(int16_t *v);
+ void setCalibrationMatrices(const float *m, const float *b);
+ float readHeading(bool calibrate=true);
+ void readHeadingVector(float *v, bool calibrate=true);
private:
I2C &i2c_;
char i2cRaw[sizeof(I2C)];
- int16_t HX;
- int16_t HZ;
- int16_t HY;
+ float _m[9];
+ float _b[3];
+ int16_t H[3];
void getHeadingRegs();
+ void computeCalibratedHeadingVector(float *v);
void writeRegister8(uint8_t reg, uint8_t value);
uint8_t readRegister8(uint8_t reg);
uint8_t fastRegister8(uint8_t reg);