Skip to content

Commit 5852be5

Browse files
committed
really fix units
1 parent 8384b03 commit 5852be5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Adafruit_LSM9DS0.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -606,12 +606,9 @@ void Adafruit_LSM9DS0::getMagEvent(sensors_event_t *event, uint32_t timestamp) {
606606
event->sensor_id = _lsm9dso_sensorid_mag;
607607
event->type = SENSOR_TYPE_MAGNETIC_FIELD;
608608
event->timestamp = timestamp;
609-
event->magnetic.x = magData.x * _mag_mgauss_lsb;
610-
event->magnetic.x /= 1000;
611-
event->magnetic.y = magData.y * _mag_mgauss_lsb;
612-
event->magnetic.y /= 1000;
613-
event->magnetic.z = magData.z * _mag_mgauss_lsb;
614-
event->magnetic.z /= 1000;
609+
event->magnetic.x = magData.x * _mag_mgauss_lsb / 10;
610+
event->magnetic.y = magData.y * _mag_mgauss_lsb / 10;
611+
event->magnetic.z = magData.z * _mag_mgauss_lsb / 10;
615612
}
616613

617614
/**************************************************************************/

0 commit comments

Comments
 (0)