Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DateTime now = RTC.now();
- filename[0] = (now.year() / 1000) % 10 + '0'; //To get 1st digit from year()
- filename[1] = (now.year() / 100) % 10 + '0'; //To get 2nd digit from year()
- filename[2] = (now.year() / 10) % 10 + '0'; //To get 3rd digit from year()
- filename[3] = now.year() % 10 + '0'; //To get 4th digit from year()
- filename[4] = now.month() / 10 + '0'; //To get 1st digit from month()
- filename[5] = now.month() % 10 + '0'; //To get 2nd digit from month()
- filename[6] = now.day() / 10 + '0'; //To get 1st digit from day()
- filename[7] = now.day() % 10 + '0'; //To get 2nd digit from day()
- Serial.println(filename);
- Serial.println("nyeeee");
- int x = 0;
- //-----------------------------------------------------
- Serial.println("siker2");
- // sprintf(data, "asd/%s", myName);
- Serial.println(data);
- //O_RDWR - open for reading and write
- //o_creat - If the file exists, this flag has no effect except as noted under O_EXCL below. Otherwise, the file shall be created
- //O_AT_END - Set the initial position at the end of the file.
- if (writeFile.open(filename, O_RDWR | O_CREAT | O_AT_END))
- {
- Serial.print("omg");
- writeFile.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement