Recording: switch commanding and different .txt saving.

Hi to all.

I’m trying to make a GPS capable to get multiple measurements in a way point. For that, I have to store the GPS’s information as it can be found in different tutorials. The thing is that the requirement of the project is to start the GPS’s recording with a switch and cut it manually after a minute and a half, and a later measurement must be saved in a different .txt file. All the data would be processed later at home. I would like to know which way this modification to standart SD shield programing can be done.
Thanks you all.

I would like to know which way this modification to standart SD shield programing can be done.

Start with some requirements that can be implemented.

The thing is that the requirement of the project is to start the GPS's recording with a switch and cut it manually after a minute and a half, and a later measurement must be saved in a different .txt file.

So, the Arduino should just randomly generate a file name, and not tell you what it is. That can be done, if that's REALLY what you want.

Recording data has nothing to do with reading it. So, on every pass through loop(), you collect whatever GPS data has arrived.

On every pass, you test whether you are to be recording. If so, you test if the time to record has elapsed. If it has, set the needToRecord flag to false. If not, you record. If you are not to record, you test the state of the switch to see if it has changed. If so, set the needToRecord flag to true.

When the needToRecord flag is set to true, open the appropriate file. When it becomes false, close the file.