Skip to content
Snippets Groups Projects
Verified Commit f77c2948 authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

fix(calib): print of values

parent e83dfb35
No related branches found
No related tags found
No related merge requests found
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
'Calibrate' the wing absolute rotary encoders. 'Calibrate' the wing absolute rotary encoders.
First we unwrap the measured position by shifting the bits in order to avoid First we unwrap the measured position by shifting the bits in order to avoid
wrapping if this is needed. wrapping if this is needed.
Then we determine the maximum position so we can make it match the maximum angle Then we determine the maximum position so we can make it match the maximum
attainable. angle attainable.
-------------------------------------------------------------------------------- -------------------------------------------------------------------------------
(c) Copyright 2022 University of Liege (c) Copyright 2022 University of Liege
Author: Thomas Lambert <t.lambert@uliege.be> Author: Thomas Lambert <t.lambert@uliege.be>
ULiege - Aeroelasticity and Experimental Aerodynamics ULiege - Aeroelasticity and Experimental Aerodynamics
...@@ -31,7 +31,7 @@ void Calibrate() { ...@@ -31,7 +31,7 @@ void Calibrate() {
Serial.print("[WARNING]: Setup will run for "); Serial.print("[WARNING]: Setup will run for ");
Serial.print(calibTime / 1000); 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."); Serial.println("[INPUT]: Type 'Y' to begin.");
while (Serial.available() == 0) {} // Wait for serial input while (Serial.available() == 0) {} // Wait for serial input
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
/******************************************************************************* /*******************************************************************************
Globals (for things that I can change manually) 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 // 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] 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[ ...@@ -267,7 +267,7 @@ void SerialPrint(String mode, int potent, int esc_val, unsigned int wing_angles[
Serial.print(","); Serial.print(",");
Serial.print(PosToDeg(wing_angles[i]) - gMaxWingPos[i] + TRUE_MAX_ANGLE); 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(",");
Serial.print(psu_vol[i]); Serial.print(psu_vol[i]);
Serial.print(","); Serial.print(",");
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Functions for sensors and acquisition. Functions for sensors and acquisition.
-------------------------------------------------------------------------------- ------------------------------------------------------------------------------
(c) Copyright 2022 University of Liege (c) Copyright 2022 University of Liege
Author: Thomas Lambert <t.lambert@uliege.be> Author: Thomas Lambert <t.lambert@uliege.be>
ULiege - Aeroelasticity and Experimental Aerodynamics ULiege - Aeroelasticity and Experimental Aerodynamics
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
Utils Utils
Miscellaneous utilities. Miscellaneous utilities.
------------------------------------------------------------------------------
--------------------------------------------------------------------------------
(c) Copyright 2022 University of Liege (c) Copyright 2022 University of Liege
Author: Thomas Lambert <t.lambert@uliege.be> Author: Thomas Lambert <t.lambert@uliege.be>
ULiege - Aeroelasticity and Experimental Aerodynamics ULiege - Aeroelasticity and Experimental Aerodynamics
...@@ -38,7 +37,7 @@ float PosToDeg(unsigned int pos) { ...@@ -38,7 +37,7 @@ float PosToDeg(unsigned int pos) {
} }
void PrintArray(int array[]) { 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]); Serial.print(array[i]);
if (i < sizeof(array) - 1) { if (i < sizeof(array) - 1) {
Serial.print(", "); Serial.print(", ");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment