From 050977b49ee88820446b733f982280142cd6e8c9 Mon Sep 17 00:00:00 2001 From: grafju78439 Date: Sat, 7 May 2022 15:43:13 +0200 Subject: [PATCH] =?UTF-8?q?wirt=5Fsd=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Teensy4.1_Datalogger new.ino | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Teensy4.1_Datalogger new.ino b/Teensy4.1_Datalogger new.ino index e7da967..f47324b 100644 --- a/Teensy4.1_Datalogger new.ino +++ b/Teensy4.1_Datalogger new.ino @@ -127,6 +127,10 @@ public: minutes_saved++; } + void print() { + + } + private: int count_per_second = 0; @@ -149,6 +153,39 @@ private: // 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() { anemometer_1.save_wind_speed();