From b70ebd3644a8eb0444cfa9ac9a046d24a0e65f34 Mon Sep 17 00:00:00 2001 From: RGIB Date: Fri, 9 Dec 2016 22:53:53 +0100 Subject: kona : correct magnetometer values Change-Id: I6a74ad728743b72d2b728f95d5f01286a23b7293 --- libsensors/CompassSensor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libsensors/CompassSensor.cpp b/libsensors/CompassSensor.cpp index 270e205..82e16a3 100644 --- a/libsensors/CompassSensor.cpp +++ b/libsensors/CompassSensor.cpp @@ -164,11 +164,11 @@ int CompassSensor::readEvents(sensors_event_t* data, int count) if (type == EV_ABS) { float value = event->value; if (event->code == EVENT_TYPE_MAGV_X) { - mPendingEvent.magnetic.x = (float)value / 1000.0f; + mPendingEvent.magnetic.x = (float)value / 20000.0f; } else if (event->code == EVENT_TYPE_MAGV_Y) { - mPendingEvent.magnetic.y = (float)value / 1000.0f; + mPendingEvent.magnetic.y = (float)value / 20000.0f; } else if (event->code == EVENT_TYPE_MAGV_Z) { - mPendingEvent.magnetic.z = (float)value / 1000.0f; + mPendingEvent.magnetic.z = (float)value / 20000.0f; } } else if (type == EV_SYN) { mPendingEvent.timestamp = timevalToNano(event->time); -- cgit v1.2.3