From a3089b40ca8a1da23df74f9d02201bbd7e4d699a Mon Sep 17 00:00:00 2001 From: Bryant Pong Date: Tue, 30 Jul 2024 19:15:41 -0700 Subject: [PATCH] Example 20 Bitwise OR Fix This commit fixes a bug in the Example 20 - Calibration Settings where logical OR was used instead of bitwise OR. The result is that the IMU's `setCalibrationConfig()` was evaluated with value 1 rather than 7. Signed-off-by: Bryant Pong --- .../Example_20_CalibrationSettings.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Example_20_CalibrationSettings/Example_20_CalibrationSettings.ino b/examples/Example_20_CalibrationSettings/Example_20_CalibrationSettings.ino index 1f31b18..98f20d5 100644 --- a/examples/Example_20_CalibrationSettings/Example_20_CalibrationSettings.ino +++ b/examples/Example_20_CalibrationSettings/Example_20_CalibrationSettings.ino @@ -118,7 +118,7 @@ void setup() { // Enable dynamic calibration for desired sensors (accel, gyro, and mag) // uncomment/comment out as needed to try various options - if (myIMU.setCalibrationConfig(SH2_CAL_ACCEL || SH2_CAL_GYRO || SH2_CAL_MAG) == true) { // all three sensors + if (myIMU.setCalibrationConfig(SH2_CAL_ACCEL | SH2_CAL_GYRO | SH2_CAL_MAG) == true) { // all three sensors //if (myIMU.setCalibrationConfig(SH2_CAL_ACCEL || SH2_CAL_MAG) == true) { // Default settings //if (myIMU.setCalibrationConfig(SH2_CAL_ACCEL) == true) { // only accel Serial.println(F("Calibration Command Sent Successfully")); @@ -241,4 +241,4 @@ void printAccuracyLevel(byte accuracyNumber) else if(accuracyNumber == 1) Serial.print(F("Low")); else if(accuracyNumber == 2) Serial.print(F("Medium")); else if(accuracyNumber == 3) Serial.print(F("High")); -} \ No newline at end of file +}