Hi guys,
I currently have 2 projects which, individually, are running great:
- GPS: Arduino Nano running a u-blox NEO-6M-v2 Sensor to collect GPS data
- SD Cardreader: Same Arduino Nano creating and writing to files and directorys
I have begun merging the 2 Projects to get a board that will collect the GPS data and send it to the SD card. So far so good, this works perfectly......
Soooo......what is my problem? Everything is working great? Weeeellll......the way i have it set up, i can only startup and shutdown the programm once. If i restart, all previosly collected data is lost, and i start out all over again. (I could continue writing to the "old" file, but i want individual files for each "session").
My idea is: I want to create a folder accoording to Timestamp "YYYYMMDD-HHMM", and write my file "GPS.txt" into that folder. Upon my next session, i want it to create a new folder with the new time, and write the data to a new "GPS.txt".
So far so good, but i am running into various Problems:
- Timestamp: The SD card sets up the file structure in the Setup. The first data (GPS RTC) is collected by the GPS only in the loop function, so late for the creation. I could put the file creation into the function, but i only need to perform it once.....if i put it in an if-clause to check if it has been created i need to check on each and every cycle, which is ... well...time wasted. Is there a more efficient way?
- Name creation: Right now i get YYYY, MM, DD and so on as individual data packages. I need to combine them into the complete package to create it. Not only that, but i also need to create another package being called "YYYYMMMDD-HHMM/GPS.txt" so i can adress and read the file. What format would be most useful for this? String?
Any hints or ideas would be very welcome.
The nano is coming pretty much to its limits, im running 70% program memory, and over 80% dynamic memory. I am hoping this will clear up some as soon as i remove all the serial debugging "serial.print", but still its very tight....