From dd0ddf5e516aa364f402eafa19a43007cd4c89d5 Mon Sep 17 00:00:00 2001 From: ctzsnooze Date: Mon, 2 Oct 2023 10:20:31 +1100 Subject: [PATCH] show true magADC values --- locales/en/messages.json | 2 +- src/js/msp/MSPHelper.js | 6 +++--- src/js/tabs/sensors.js | 6 +++--- src/tabs/sensors.html | 9 +++++++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/locales/en/messages.json b/locales/en/messages.json index 3861e75ff6..e896d583d9 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -3097,7 +3097,7 @@ "message": "Accelerometer - g (deg)" }, "sensorsMagTitle": { - "message": "Magnetometer - Ga" + "message": "Magnetometer" }, "sensorsAltitudeTitle": { "message": "Altitude - meters" diff --git a/src/js/msp/MSPHelper.js b/src/js/msp/MSPHelper.js index 6379965a04..8cb6d491df 100644 --- a/src/js/msp/MSPHelper.js +++ b/src/js/msp/MSPHelper.js @@ -239,9 +239,9 @@ MspHelper.prototype.process_data = function(dataHandler) { FC.SENSOR_DATA.gyroscope[2] = data.read16() * (4 / 16.4); // no clue about scaling factor - FC.SENSOR_DATA.magnetometer[0] = data.read16() / 1090; - FC.SENSOR_DATA.magnetometer[1] = data.read16() / 1090; - FC.SENSOR_DATA.magnetometer[2] = data.read16() / 1090; + FC.SENSOR_DATA.magnetometer[0] = data.read16(); + FC.SENSOR_DATA.magnetometer[1] = data.read16(); + FC.SENSOR_DATA.magnetometer[2] = data.read16(); break; case MSPCodes.MSP_SERVO: const servoCount = data.byteLength / 2; diff --git a/src/js/tabs/sensors.js b/src/js/tabs/sensors.js index 757f323646..5fab4783ba 100644 --- a/src/js/tabs/sensors.js +++ b/src/js/tabs/sensors.js @@ -429,9 +429,9 @@ sensors.initialize = function (callback) { samples_mag_i = addSampleToData(mag_data, samples_mag_i, FC.SENSOR_DATA.magnetometer); drawGraph(magHelpers, mag_data, samples_mag_i); - raw_data_text_ements.x[2].text(FC.SENSOR_DATA.magnetometer[0].toFixed(2)); - raw_data_text_ements.y[2].text(FC.SENSOR_DATA.magnetometer[1].toFixed(2)); - raw_data_text_ements.z[2].text(FC.SENSOR_DATA.magnetometer[2].toFixed(2)); + raw_data_text_ements.x[2].text(FC.SENSOR_DATA.magnetometer[0].toFixed(0)); + raw_data_text_ements.y[2].text(FC.SENSOR_DATA.magnetometer[1].toFixed(0)); + raw_data_text_ements.z[2].text(FC.SENSOR_DATA.magnetometer[2].toFixed(0)); } } diff --git a/src/tabs/sensors.html b/src/tabs/sensors.html index 0900564544..ec45e47500 100644 --- a/src/tabs/sensors.html +++ b/src/tabs/sensors.html @@ -143,8 +143,13 @@
X: