Currently, a new file on the SD card is created only on each powering on/reset of the device. This creates two problems:
A file is created when the device is powered on, even if no run is created.
Trying to create multiple runs using the start/stop button (without resetting the device) will cause multiple, possibly inadvertent, writes to the same file.
A fix to this should likely create a file when the logging starts. Since file naming currently occurs only once, it will also have to be moved such that it occurs each time a new file is created.
(Possibly nest the name-determination, the file creation/header text writing, and the name-assignment into a function to occur only when logging <= !logging?)
Currently, a new file on the SD card is created only on each powering on/reset of the device. This creates two problems:
A fix to this should likely create a file when the logging starts. Since file naming currently occurs only once, it will also have to be moved such that it occurs each time a new file is created. (Possibly nest the name-determination, the file creation/header text writing, and the name-assignment into a function to occur only when logging <= !logging?)