Reading data from a text file on my computer

PaulS:

Is there a way to EASILY (I'm a noob) read this CSV file and stick the values into 4 (long) int variables

Read it where? On the Arduino or on the PC?

CSV is stored on the PC, I want to read it on the Ardunio.

for (int i = 19 ; i >=0 ; i--) {

timeHistory[i] = timeHistory[i-1];
   sensor1History[i] = sensor1History[i-1]
   //....
}



Tell me exactly what happens when i is 0 on the last pass through this loop.

Oops, it should be i > 0. The (0) indices are filled in after the for loop.

It would be quite nice if it can be done in close to "real time".

You want to read historical data "real time"? How does that make sense?

Taking action at intervals, as determined by the difference between two timestamps is a different story.

Okay, I'll try this again. I am taking action in intervals based on the differences in timestamps and values in the sensor readings. What I would like to do is SIMULATE getting the data in real time if that makes sense.

The sample data in the CSV file was obtained from the Arduino and the sensors with about 1 reading every ms, but that was from a sketch that ONLY read the sensors and sent the comma delimited output to the Serial port. It didn't do anything else. Realistically, 1 reading every 10 - 30 ms would be fine once I put all the pieces together, the smaller the better obviously.

If I was to type in the historical data manually at the Serial Monitor the system would be getting about 1 reading for all 3 sensors per 1000 ms (if I type fast). I would not be able to judge if the system is working properly at that rate, since part of my code testing and fiddling is seeing how "instant" the response to the change in sensor readings is.

For example, 5 seconds into the CSV test file, the wheel was manually stopped for 3 seconds. So what I would like to see is 5 seconds after I start the sketch using the CSV file is for my light on Pin 13 to turn on for 3 seconds, then turn off.

Does that help?