CG_scale
CG_scale copied to clipboard
Compilation error in function 'runAutoCalibrate'
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; }