Closed mikebolt closed 8 years ago
I haven't observed such phenomenon. Just note that when you open the serial monitor, the atmega328p will reset and that will cause a new file to be created.
OK. That's good to know.
Duplicate files are always created, even when the device is powered through OBD and not connected through USB. Data is always written to even numbered data files, and odd numbered files are always empty.
On Oct 14, 2016 5:54 PM, "Stanley Huang" notifications@github.com wrote:
I have observed such phenomenon. Just note that when you open the serial monitor, the atmega328p will reset and that will cause a new file to be created.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stanleyhuangyc/Freematics/issues/21#issuecomment-253951768, or mute the thread https://github.com/notifications/unsubscribe-auth/ACCav0Twxb0F8Fq_S6JJNX_-ILgBh5aqks5q0CQ3gaJpZM4KM3f4 .
The datalogger sketch creates an extra DAT file each time it creates a DAT file. The result is that it always creates an even number of DAT files, and all of the odd-numbered DAT files are completely empty.
The following code is probably relevant:
The problem appears to be that
one.openFile(0)
is called twice: once to save the result intoindex
, and another time to use the result in the if statement. I tried replacing the second call in the comparison expression with the value ofindex
, but that didn't work for some reason. I think that it resulted in no data being recorded at all.