wirt_sd ergänzt

This commit is contained in:
Julian Graf 2022-05-07 15:43:13 +02:00
parent 181ba992fb
commit 050977b49e

View File

@ -127,6 +127,10 @@ public:
minutes_saved++; minutes_saved++;
} }
void print() {
}
private: private:
int count_per_second = 0; int count_per_second = 0;
@ -149,6 +153,39 @@ private:
// Define Functions below here or use other .ino or cpp files // Define Functions below here or use other .ino or cpp files
// //
void dateTime(uint16_t* date, uint16_t* time, uint8_t* ms10) {
// Return date using FS_DATE macro to format fields.
*date = FS_DATE(year(), month(), day());
// Return time using FS_TIME macro to format fields.
*time = FS_TIME(hour(), minute(), second());
// Return low time bits in units of 10 ms.
*ms10 = second() & 1 ? 100 : 0;
}
void write_sd() {
char file_name[50];
FsDateTime::setCallback(dateTime);
sprintf(file_name, "Windmessmast-%d.%d.%d_%d:%d.txt", year(), month(), day(), hour(), minute());
sd.begin(SD_CONFIG);
if (file.open(file_name, FILE_WRITE)) {
Serial.println("Start SD schreiben");
file.println("Messdaten von Windmessmasst");
file.println();
file.println("Data logger : Teensy 4.2");
file.println(software_name);
file.println();
file.println("");
}
}
void every_second() { void every_second() {
anemometer_1.save_wind_speed(); anemometer_1.save_wind_speed();