2025-12-1205
This commit is contained in:
34
include/mess_Ub.h
Normal file
34
include/mess_Ub.h
Normal file
@@ -0,0 +1,34 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user