From 6950abd259828df7061a809d1641dee7df8b03a3 Mon Sep 17 00:00:00 2001 From: Carlo Parata Date: Fri, 29 Sep 2023 13:14:01 +0200 Subject: [PATCH] Update LSM6DSV16X_Sensor_Fusion.ino Signed-off-by: Carlo Parata --- .../LSM6DSV16X_Sensor_Fusion.ino | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/LSM6DSV16X_Sensor_Fusion/LSM6DSV16X_Sensor_Fusion.ino b/examples/LSM6DSV16X_Sensor_Fusion/LSM6DSV16X_Sensor_Fusion.ino index 79764e8..b022009 100644 --- a/examples/LSM6DSV16X_Sensor_Fusion/LSM6DSV16X_Sensor_Fusion.ino +++ b/examples/LSM6DSV16X_Sensor_Fusion/LSM6DSV16X_Sensor_Fusion.ino @@ -13,6 +13,12 @@ ******************************************************************************* */ + +/* + * You can display the quaternion values with a 3D model connecting for example to this link: + * https://adafruit.github.io/Adafruit_WebSerial_3DModelViewer/ + */ + #include #define ALGO_FREQ 120U /* Algorithm frequency 120Hz */ @@ -69,13 +75,13 @@ void loop() // Print Quaternion data Serial.print("Quaternion: "); - Serial.print(quaternions[3], 4); + Serial.print(-quaternions[3], 4); Serial.print(", "); - Serial.print(-quaternions[1], 4); + Serial.print(-quaternions[0], 4); Serial.print(", "); - Serial.print(quaternions[0], 4); + Serial.print(-quaternions[1], 4); Serial.print(", "); - Serial.println(quaternions[2], 4); + Serial.println(-quaternions[2], 4); // Compute the elapsed time within loop cycle and wait elapsedTime = millis() - startTime;