IMU Sensor stops updating values after SD Card activated

MK1888:
Your program could be written better. If the second IF block in the main loop() never executes then your sensor never updates after the first time. Likewise, if the execution stays in the second IF block your sensor will also not update after the first time.

But your problem is likely that your variable lastStreamTime is never updated at all. You set it to zero at the beginning and that's it. Your program probably stays in the second IF block forever.

A simple print statement between your two IF blocks would have clued you in to this.

Not updating lastStreamTime (which, I grant you, is a significant oversight) won't stop it executing the second block because the left side of the inequality being tested will always be increasing. The impact is that it'll be executing on each run through the loop, which means that it's then updating the sensor data every time as well. I tried putting the sensor update lines inside the second IF statement to make sure that that wasn't the problem, and what do you know - exactly the same problem.

And when I remove the line initialising the SD card, it magically starts streaming correct data to the serial monitor. So the problem isn't a coding issue (though of course I accept that this bodged-together code isn't great). Any insight into what might be causing the SD initialisation to break the data update?