35 lines
717 B
C
35 lines
717 B
C
const float MinimalSpannung = 3.20;
|
|
float korectur = 1;
|
|
|
|
float getBattery(float ref = 0.00945)
|
|
{
|
|
float valA0 = analogRead(A0) * ref;
|
|
Serial.print("Batterie:\t");
|
|
Serial.print(valA0,4);
|
|
Serial.print(" V\n");
|
|
return valA0;
|
|
}
|
|
|
|
float readKorectur(){
|
|
float korectur;
|
|
File k = LittleFS.open("/kor.txt", "r");
|
|
if(!k){
|
|
//Serial.println("file open failed");
|
|
korectur = 0.01;
|
|
}else{
|
|
String data = k.readString();
|
|
korectur = data.toFloat();
|
|
k.close();
|
|
}
|
|
return korectur;
|
|
}
|
|
void saveKorektur(){
|
|
File k = LittleFS.open("/kor.txt", "w");
|
|
if(!k){
|
|
Serial.println("file open failed");
|
|
}else{
|
|
k.println(String(korectur,8));
|
|
k.close();
|
|
}
|
|
}
|