Sending MPU6050 data from an UNO to a MEGA and then writing to an SDCard on the MEGA.
For awhile my data seems to be reading and printing to the serial monitor just fine, but after is has been recording for awhile, it will sometimes have these lines where it looks like only part of the data is being printed.
I attached a picture of the serial monitor to show.
The SD card does take some time to write the data to the card and 9600 baud is relatively slow so it takes time to print out things to the serial monitor.
blh64:
The SD card does take some time to write the data to the card and 9600 baud is relatively slow so it takes time to print out things to the serial monitor.
Have you tried opening Serial at 115200?
Thanks for replying! Unfortunately, changing the baud to 115200 didn't fix the problem.
It's not a huge problem because it only happens every few hundred data points, which isn't a big deal, but I'm afraid that this small error is something that could be the underlying cause of a much bigger error down the road. It also seems to happen more often when my MPU data is changing and not sitting still.
blh64:
The SD card does take some time to write the data to the card and 9600 baud is relatively slow so it takes time to print out things to the serial monitor.
I think this is the problem for sure. One way I got this to work was by only opening the file one time in the setup and then closing it at a timer event later on. This works for my project because we need to only be taking data for about 5 minutes, but is there a reason why this might go wrong or cause problems?