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.
Revision 5:778bddacaa80, committed 2022-04-21
- Comitter:
- oslejste
- Date:
- Thu Apr 21 19:07:15 2022 +0000
- Parent:
- 4:3618abce1646
- Commit message:
- Oledmag;
Changed in this revision
| MMC5883L.lib | Show diff for this revision Revisions of this file |
| MMC5883L/MMC5883L.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MMC5883L.lib Thu Apr 21 13:19:41 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -MMC5883L#000000000000 -
--- a/MMC5883L/MMC5883L.cpp Thu Apr 21 13:19:41 2022 +0000
+++ b/MMC5883L/MMC5883L.cpp Thu Apr 21 19:07:15 2022 +0000
@@ -158,16 +158,15 @@
void MMC5883L::getXYZ_OffsetRemoved_RAW(int16_t output[3])
{
// TODO: offset reemove
- int16_t data_set[3];
+ double sensitivity = 0.05;
+ int16_t set_data[3];
+ int16_t reset_data[3];
flipSet();
- getXYZ_RAW(data_set);
- int16_t data_reset[3];
+ getXYZ_RAW(set_data);
flipReset();
- getXYZ_RAW(data_reset);
-
+ getXYZ_RAW(reset_data);
for(int i = 0; i < 3; i++) {
- int16_t diff = data_reset[i] - data_set[i];
- output[i] = data_reset[i] - diff/2;
+ output[i] = (reset_data[i] - set_data[i])/2*sensitivity;
}
}