Skip to content

Commit ad7b537

Browse files
committed
Fix naming in example
1 parent 13ca54d commit ad7b537

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,25 @@ The access to the sensor value is done as explained below:
4141

4242
All the MEMS drivers in stm32duino repositories have the same units when returning physical (scaled) values:
4343

44-
- mg for accelerometer (thousandth of 1g that is 9.81 m/s^2)
44+
- mg for accelerometer (thousandth of g, 1g is 9.81 m/s^2)
4545
- mdps for gyroscope (thousandth of degree/s)
4646
- mgauss for magnetometer (thousandth of gauss)
4747

48-
Readings can be obtained either as raw (unscaled) ```uint16_t``` values from the ```XXX_GetAxesRaw``` functions, or as physical (scaled) ```uint32_t``` values from the ```XXX_GetAxes``` functions, where ```XXX``` is eithet ```ACC``` or ```GYRO```. The factor to use for scaling from a raw to a physical value is from the ```XXX_GetSensitivity``` functions.
48+
Readings can be obtained either as raw (unscaled) ```uint16_t``` values from the ```XXX_GetAxesRaw``` functions, or as physical (scaled) ```uint32_t``` values from the ```XXX_GetAxes``` functions, where ```XXX``` is either ```ACC``` or ```GYRO```. The factor to use for scaling from a raw to a physical value is obtained from the ```XXX_GetSensitivity``` functions.
4949

5050
For example, to convert the raw acceleration reading to float m/s^2, the following can be done:
5151

5252
```cpp
5353
int16_t acc_raw[3];
54-
float acc_g[3];
54+
float acc_ms2[3];
5555
float acc_sensitivity;
5656

5757
AccGyr.ACC_GetAxesRaw(acc_raw);
5858
AccGyr.ACC_GetSensitivity(&acc_sensitivity);
5959

60-
acc_g[0] = ((float)acc_raw[0] * acc_sensitivity) / 1000.0f * 9.81f;
61-
acc_g[1] = ((float)acc_raw[1] * acc_sensitivity) / 1000.0f * 9.81f;
62-
acc_g[2] = ((float)acc_raw[2] * acc_sensitivity) / 1000.0f * 9.81f;
60+
acc_ms2[0] = ((float)acc_raw[0] * acc_sensitivity) / 1000.0f * 9.81f;
61+
acc_ms2[1] = ((float)acc_raw[1] * acc_sensitivity) / 1000.0f * 9.81f;
62+
acc_ms2[2] = ((float)acc_raw[2] * acc_sensitivity) / 1000.0f * 9.81f;
6363
```
6464

6565
## Documentation

0 commit comments

Comments
 (0)