On clicking an OK button I have a string of values, namely:
88,2015,5,17,22,6,53,2015,05,17,22,06,53,0,0,0,0,0,0,0,0
I am going to be sending these to an Arduino via serial, the problem is the format they are in at the moment.
The Arduino is expecting them in the same format (data type) as one would send from the serial terminal window and without a newline character added.
I am currently using Serial.parseint()
in my code on the Arduino to receive the values separated by commas and load them into variables. (Which currently is working when I type the following into a serial terminal window:
88,2015,5,17,22,6,53,2015,05,17,22,06,53,0,0,0,0,0,0,0,0
)
I could probably do this:
string mystr = "88,2015,5,17,22,6,53,2015,05,17,22,06,53,0,0,0,0,0,0,0,0";
int[] nums = Array.ConvertAll(s.Split(','), int.Parse);
But the I have to take them back to the same format.
How to I set/change the value of mystr
to what the Arduino needs?