21
21
version 2.0.0
22
22
*/
23
23
24
- #ifndef LSM9DS1_V2.0
25
- #define LSM9DS1_V2 .0
24
+ #ifndef LSM9DS1_V2
25
+ #define LSM9DS1_V2
26
26
#endif
27
27
28
28
#define accelerationSampleRate getAccelODR
@@ -74,12 +74,12 @@ class LSM9DS1Class {
74
74
75
75
// Accelerometer
76
76
float accelOffset[3 ] = {0 ,0 ,0 }; // zero point offset correction factor for calibration
77
- float accelSlope[3 ] = {1 ,1 ,1 }; // slope correction factor for calibration
78
- float accelUnit = GRAVITY; // GRAVITY OR METERPERSECOND2
77
+ float accelSlope[3 ] = {1 ,1 ,1 }; // slope correction factor for calibration
78
+ float accelUnit = GRAVITY; // GRAVITY OR METERPERSECOND2
79
79
virtual int readAccel (float & x, float & y, float & z); // Results are in G (earth gravity) or m/s2.
80
80
virtual int accelAvailable (); // Number of samples in the FIFO.
81
- virtual void setAccelOffset (float x, float y, float z); // Look out, from measurements only
82
- virtual void setAccelSlope (float x, float y, float z);
81
+ virtual void setAccelOffset (float x, float y, float z); // Look out, from measurements only
82
+ virtual void setAccelSlope (float x, float y, float z);
83
83
virtual int setAccelODR (int8_t range); // Sample Rate 0:off, 1:10Hz, 2:50Hz, 3:119Hz, 4:238Hz, 5:476Hz, 6:952Hz, 7:NA Automatic setting of BW
84
84
virtual float getAccelODR (); // Sample Rate of the sensor.
85
85
virtual float setAccelBW (int8_t range); // 0,1,2,3 Override autoBandwidth setting see doc.table 67
@@ -88,13 +88,13 @@ class LSM9DS1Class {
88
88
virtual float getAccelFS (); // Full Scale setting (output = 2.0, 16.0 , 4.0 , 8.0)
89
89
90
90
// Gyroscope
91
- float gyroOffset[3 ] = {0 ,0 ,0 }; // zero point offset correction factor for calibration
92
- float gyroSlope[3 ] = {1 ,1 ,1 }; // slope correction factor for calibration
91
+ float gyroOffset[3 ] = {0 ,0 ,0 }; // zero point offset correction factor for calibration
92
+ float gyroSlope[3 ] = {1 ,1 ,1 }; // slope correction factor for calibration
93
93
float gyroUnit = DEGREEPERSECOND; // DEGREEPERSECOND or RADIANSPERSECOND
94
94
virtual int readGyro (float & x, float & y, float & z); // Results are in degrees/second or rad/s.
95
95
virtual int gyroAvailable (); // Number of samples in the FIFO.
96
- virtual void setGyroOffset (float x, float y, float z); // Look out, from measurements only
97
- virtual void setGyroSlope (float x, float y, float z);
96
+ virtual void setGyroOffset (float x, float y, float z); // Look out, from measurements only
97
+ virtual void setGyroSlope (float x, float y, float z);
98
98
virtual int setGyroODR (int8_t range); // Sampling Rate 0:off, 1:10Hz, 2:50Hz, 3:119Hz, 4:238Hz, 5:476Hz, 6:952Hz, 7:NA
99
99
virtual float getGyroODR (); // Sampling rate of the sensor.
100
100
virtual int setGyroBW (int8_t range); // Bandwidth setting 0,1,2,3 see documentation table 46 and 47
@@ -103,13 +103,13 @@ class LSM9DS1Class {
103
103
virtual float getGyroFS (); // (output = 245.0, 500.0 , 1000.0, 2000.0)
104
104
105
105
// Magnetometer
106
- float magnetOffset[3 ] = {0 ,0 ,0 }; // zero point offset correction factor for calibration
107
- float magnetSlope[3 ] = {1 ,1 ,1 }; // slope correction factor for calibration
106
+ float magnetOffset[3 ] = {0 ,0 ,0 }; // zero point offset correction factor for calibration
107
+ float magnetSlope[3 ] = {1 ,1 ,1 }; // slope correction factor for calibration
108
108
float magnetUnit = MICROTESLA; // GAUSS or MICROTESLA
109
109
virtual int readMagnet (float & x, float & y, float & z); // Default results are in uT (micro Tesla)
110
110
virtual int magnetAvailable (); // Number of samples in the FIFO.
111
- virtual void setMagnetOffset (float x, float y, float z); // Look out, from measurements only
112
- virtual void setMagnetSlope (float x, float y, float z);
111
+ virtual void setMagnetOffset (float x, float y, float z); // Look out, from measurements only
112
+ virtual void setMagnetSlope (float x, float y, float z);
113
113
virtual int setMagnetODR (int8_t range); // Sampling rate (0..7) corresponds to {0.625,1.25,2.5,5.0,10.0,20.0,40.0,80.0}Hz
114
114
virtual float getMagnetODR (); // Sampling rate of the sensor in Hz.
115
115
virtual int setMagnetFS (int8_t range); // 0=400.0; 1=800.0; 2=1200.0 , 3=1600.0 (µT)
0 commit comments