Wetterstation_Boris/include/error.h
hans-jurgen fea3fe2e3d 2023-05-18
Einiges geändert in main
2023-05-18 23:38:20 +02:00

37 lines
568 B
C

#include <Arduino.h>
#include <LittleFS.h>
#define AkkuLeer 0x80
void ErrorBegin(){
if (!LittleFS.begin()) {
Serial.println("LittleFS mount failed");
delay(5000);
return;
}
}
void datenSave(int wert){
File k = LittleFS.open("/error.dat", "w");
if(!k){
Serial.println("file open failed");
}
k.write(wert);
k.close();
}
int readDaten()
{
int Error;
File k = LittleFS.open("/error.dat", "r");
if(!k){
Serial.println("file open failed");
Error = 255;
}else{
Error = k.read();
k.close();
}
return Error;
}