Hi, first time poster, long time peruser...
My problem is this. I have a adafruit 3v Trinket Pro with LipO backpack for power that has as MPU6050 accelerometer & Gyro and an DS1307 Real Time Clock on the I2C bus. I also have an SD card on the SPI bus.
At power on I get the time/date from the realtime clock and put it in a file on the SD (data00.csv).
Then I am taking readings from the MPU6050 and writing them to the SD card along with the millis since power on.
My problem is that writing to the SD stops after a variable amount of time around the 45minute to 2 hour mark. I can see this as the SCK of the SPI is pin 13 on the Trinket Pro, which also shares the inbuilt led. so this goes out...
I have this problem when powered from USB and from the LiPo.
I have added in and used the freemem library to track the memory usage, and there appears to be no memory leak (788bytes free constantly...) (library removed now)
The cycle time for the sketch appears to increase slowly (by 10-20 milliseconds total over an hour). I put this down to writing larger and larger values of millis() to the SD...
I'm completely out of ideas now! Can anyone help? Thanks in advance!
Code attached....
ParkinsonsArduino7_6.ino (10.3 KB)