fea3fe2e3d
Einiges geändert in main
37 lines
568 B
C
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;
|
|
} |