Hi!
My goal is to use an Arduino to send processing multiple sensor readings and display them. Right now I am sending the values as a comma-separated string, and then plan on displaying each value individually by splitting the string apart.
When I send processing the test value of: 2085.46,5 my code only recognizes the second part (the 5) as a number and displays the first section (2085.46) as 0.
inString = myPort.readStringUntil('\n');
print(inString);
inString = trim(inString);
String[] splitstring = split(inString, ",");
println(int(splitstring));
I am guessing this is because the first value is a float, however, I need those decimal places so I cannot have the Arduino simply convert it to an int.
I have looked at split tokens, but I honestly don’t understand how it is different nor do I know how to use it.
Lastly, as an afterthought, because I haven’t been able to try yet, can I call print(splitstring[0]); to print only the first value in the split string?