Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error in function 'runAutoCalibrate' #24

Open
goepel opened this issue Apr 16, 2023 · 0 comments
Open

Compilation error in function 'runAutoCalibrate' #24

goepel opened this issue Apr 16, 2023 · 0 comments

Comments

@goepel
Copy link

goepel commented Apr 16, 2023

Hallo,

ich verwende das Arduino IDE V2.0.4 und ein Adafruit Feather HUZZAH ESP8266. Beim kompilieren gibt es eine Fehlermeldung 'Compilation error: no return statement in function returning non-void [-Werror=return-type]' die auf ein fehlendes return statement in der Funktion 'runAutoCalibrate' hinweist.
Kann es sein, dass in Zeile 558 noch ein 'return true;' hinzugefügt werden muss?

// run auto calibration
bool runAutoCalibrate() {
Serial.print(F("\nAutocalibration is running"));
for (int i = 0; i <= 20; i++) {
Serial.print(F("."));
delay(100);
}
// calculate weight
float toWeightLoadCell[] = {0, 0, 0};
toWeightLoadCell[LC2] = ((refCG - model.distance[X1]) * refWeight) / model.distance[X2];
toWeightLoadCell[LC1] = refWeight - toWeightLoadCell[LC2];
if (nLoadcells == 3) {
toWeightLoadCell[LC1] = toWeightLoadCell[LC1] / 2;
toWeightLoadCell[LC3] = toWeightLoadCell[LC1];
}
// calculate calibration factors
for (int i = LC1; i <= LC3; i++) {
calFactorLoadcell[i] = calFactorLoadcell[i] / (toWeightLoadCell[i] / weightLoadCell[i]);
saveCalFactor(i);
}

// finish
Serial.println(F("done"));
return true;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant