I'm trying to write a program for my Arduino project to detect REM (the dreaming stage of sleep) with electrode sensors. However, it's time consuming to only test my code at night when I'm sleeping.
I'd like a way to record the electrode sleep data at night, and then be able play it back through the arduino program when I'm awake, or run sections of it, in order to develop the code.
Any guidance appreciated.
Details/ More Questions:
data file size
If I collect the data from the serial monitor and save it to a text file, the data ends up being around 3mb, because it's a stream of data for about 8 hours.
It would be ideal to save the data without having to be connected to the computers' serial port for battery life reasons, but the serial monitor works for now.
The part that confuses me most is how would I play pack the data? The data is a stream, but Arduino doesn't run its loops at consistent intervals.
For example, I might collect this sleep data in 4
millis: 1 electrode: 234 millis: 7 electrode: 238 millis: 14 electrode: 230 millis: 19 electrode: 229
But I cannot ensure that I play back the electrode data through the device at the exact millisecond intervals they were recorded because the arduino loops seem to vary in millis.
And to complicate matters more, if I had to add an SD card to read back the mock data, wouldn't reading the SD card slow the loops down further? These inconsistencies with playing back the recorded data seem like they would effect the my ability to write a program for real data based on mock playback data.
But am I over thinking this? Does it not make that much of a difference?
How might one go about recording and playing back long streams of data or thinking about this problem?
It seems like I might want to make my program work at a consistent sampling rate- sampling rate tutorial. Up until now, I've been taking data on every loop, instead of at a consistent rate. This would probably mean changing my existing code. One thing I'm still confused about is how do you know what sampling rate to pick to ensure that you don't have any void loops that take longer than the samping rate?