I am trying to read data streamed from a sensor into Excel via VBA using modCOMM (by David M. Hitchner).
The data from the sensor is streamed to the serial port by the Arduino with the Serial.print command and consists of a maximum of 7 ASCII string characters separated with a comma between each by using the Serial.print(",") command.
Currently, I can open the serial port and read the data into Excel. I've set-up a command button to read the data and display it in Excel and the data updates with each button click.
The problem is I don't know how to separate each data point so they are useful. Ideally, I would like to take a sample of readings (say 20) from the streaming serial data, average them and use it as a data point in the spreadsheet.
I'm guessing there must be a way to read and store the characters until a comma is read, add that value to a running total, and then get the next character set..etc. I'm also guessing there is a way to verify each data point is good (not corrupted in transmission).
Will someone here please point me in the right direction on this?
Any help is appreciated.