I wanted to get started setting up base functionality that would respond to the data coming out of the arduino-processing data log file automatically.
My system architecture idea is as follows:
Each user will have a separate arduino – processing bridge, (the arduino can be the same one physically, but more will allow discrete locations)…
Each bridge will create a text file on a separate system running its own instance of unity and the collaborative experiments.
The text will be setup as a Comma separated value file:
The whole log file is read using streamreader, put into a string, this string is split at the end of line (\n) into an array of strings. Each looks like “Sensor1,Sensor2,Sensor3,Sensor4,” Then by separating each string into its component characters and counting the number of commas, the number of values is identified. This allows the system a small amount of flexibility, If the arduino – processing bridge is only producing a text log with 3 sensor streams we can avoid building another array to hold that data, and the system can automatically create new arrays if extra sensors are connected later without being tweaked.