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 @@
'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
......
......@@ -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(",");
......
......@@ -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
......
......@@ -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(", ");
......
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