Arcadie Cracan / HMC5983

Dependents:   compassDemo weather_station_proj weather_station_project weather_station_proj_v1_2

Revision:
1:fb6804e865fd
Parent:
0:cffff4c45a14
Child:
2:4debef04091d
--- a/HMC5983.h	Fri Jun 15 12:22:40 2018 +0000
+++ b/HMC5983.h	Thu Jul 05 15:43:14 2018 +0000
@@ -16,7 +16,7 @@
 #include "mbed.h"
 
 #ifndef M_PI
-#define M_PI           3.14159265358979323846
+#define M_PI           3.14159265358979323846f
 #endif
 
 // I2C ADDRESS
@@ -121,11 +121,18 @@
     void  setSampleAverages(hmc5983_sampleAverages_t sampleAverages);
     hmc5983_sampleAverages_t getSampleAverages(void);
     
-    double read();
+    float readHeading();
+    void readHeadingVector(int16_t *v);
     
   private:
     I2C &i2c_;
     char i2cRaw[sizeof(I2C)];
+    int16_t HX;
+    int16_t HZ;
+    int16_t HY;
+
+    
+    void getHeadingRegs();
     void writeRegister8(uint8_t reg, uint8_t value);
     uint8_t readRegister8(uint8_t reg);
     uint8_t fastRegister8(uint8_t reg);