diff --git a/controller/calibration.ino b/controller/calibration.ino index e704faee86385d76ac90fc4d7a4a321e7bb03f51..a1ad945a8d006abbe87a014863e5cc10fba0d9e2 100644 --- a/controller/calibration.ino +++ b/controller/calibration.ino @@ -4,10 +4,10 @@ 'Calibrate' the wing absolute rotary encoders. First we unwrap the measured position by shifting the bits in order to avoid wrapping if this is needed. - Then we determine the maximum position so we can make it match the maximum angle - attainable. + Then we determine the maximum position so we can make it match the maximum + angle attainable. - -------------------------------------------------------------------------------- + ------------------------------------------------------------------------------- (c) Copyright 2022 University of Liege Author: Thomas Lambert <t.lambert@uliege.be> ULiege - Aeroelasticity and Experimental Aerodynamics @@ -31,7 +31,7 @@ void Calibrate() { Serial.print("[WARNING]: Setup will run for "); Serial.print(calibTime / 1000); - Serial.print("s to get the offset and maximum value."); + Serial.println("s to get the offset and maximum value."); Serial.println("[INPUT]: Type 'Y' to begin."); while (Serial.available() == 0) {} // Wait for serial input diff --git a/controller/controller.ino b/controller/controller.ino index 7354fbcbf4bcf7778033969c88d27510d6c53b85..d0757babba568f2b6ab118b5b1a92dfc0546a2d1 100644 --- a/controller/controller.ino +++ b/controller/controller.ino @@ -64,7 +64,7 @@ /******************************************************************************* Globals (for things that I can change manually) *******************************************************************************/ -const boolean gSKIP_CALIB = true; // Skip calibration or not +const boolean gSKIP_CALIB = false; // Skip calibration or not // Constant values that can be tweaked here or in the ESC before run const uint16_t gMAX_SIG = 2000; // Max signal to the ESC [ms] @@ -267,7 +267,7 @@ void SerialPrint(String mode, int potent, int esc_val, unsigned int wing_angles[ Serial.print(","); Serial.print(PosToDeg(wing_angles[i]) - gMaxWingPos[i] + TRUE_MAX_ANGLE); } - for (int i = 0; i < sizeof(psu_vol); i++) { + for (int i = 0; i < sizeof(psu_vol) / sizeof(psu_vol[0]); i++) { Serial.print(","); Serial.print(psu_vol[i]); Serial.print(","); diff --git a/controller/sensors.ino b/controller/sensors.ino index b3d3bb402ec24ec1db421a1c1bf6576066b37b6d..6fbab66e7b57e26727d3bcf6aa141597f903cd4e 100644 --- a/controller/sensors.ino +++ b/controller/sensors.ino @@ -3,7 +3,7 @@ Functions for sensors and acquisition. - -------------------------------------------------------------------------------- + ------------------------------------------------------------------------------ (c) Copyright 2022 University of Liege Author: Thomas Lambert <t.lambert@uliege.be> ULiege - Aeroelasticity and Experimental Aerodynamics diff --git a/controller/utils.ino b/controller/utils.ino index 344f6c67cb0498cac6ddd5b5c3dd750cd8b836ee..6d3f3cbe8c5886bb6409b7d1c4a82b2d5b9d047a 100644 --- a/controller/utils.ino +++ b/controller/utils.ino @@ -2,8 +2,7 @@ Utils Miscellaneous utilities. - - -------------------------------------------------------------------------------- + ------------------------------------------------------------------------------ (c) Copyright 2022 University of Liege Author: Thomas Lambert <t.lambert@uliege.be> ULiege - Aeroelasticity and Experimental Aerodynamics @@ -38,7 +37,7 @@ float PosToDeg(unsigned int pos) { } void PrintArray(int array[]) { - for (int i = 0; i < sizeof(array); i++) { + for (int i = 0; i < sizeof(array) / sizeof(array[0]); i++) { Serial.print(array[i]); if (i < sizeof(array) - 1) { Serial.print(", ");