Hi Guys,
Im using the Uno R3 board to read a whole bunch of sensors and then output the information into a CSV file using the Terminal.exe software found here. Terminal
I have had a search around on the forum and nothing I can find seems to be similar to this:
The problem I have been getting is occasionally, one of the lines that is output will be missing a value, or randomly have an extra delimiter (comma in this case) thrown in, which as you can understand upsets my columns.
Now I am trying something a little more complicated where I include an excel equation as the last line to print, this is garbelled about 10% of the time, which I dont understand why.
Is this a problem with my baud rate? I have tried from 1200 to 19200 and the results seem pretty similar. Should I be using .print or .write? I think .write is quicker? Or do you think there is some problem with the capture software I am using? It doesnt seem like it could be that as its just doing a basic task of reading serial data. OR any recommendations on better ways to log to a CSV file with the end user having no coding background?
My problematic code is below, along with a screenshot
//Include lambda decay equations inside the CSV file and select the correct index...................................................
Serial.write("Lambda Decay value:");
Serial.write(",");
Serial.println("R^2 Value:");
delay(100);
Serial.write("\"");
Serial.write("=INDEX(LINEST(LN(C");
Serial.print(index1);
Serial.write(":C");
Serial.print(index2);
Serial.write(")");
Serial.write(",A");
Serial.print(index1);
Serial.write(":A");
Serial.print(index2);
Serial.write("/1000000),");
Serial.write("1)\"");
delay(100);
Serial.write(",");
Serial.write("\"");
Serial.write("=RSQ(LN(C");
Serial.print(index1);
Serial.write(":C");
Serial.print(index2);
Serial.write(")");
Serial.write(",A");
Serial.print(index1);
Serial.write(":A");
Serial.print(index2);
Serial.write(")");
Serial.println("\"");
//...
Any help would be appreciated, it could be as simple as poor poor programming,
Thanks