I am receiving a 2 value string from an arduino delimited by a space.
if(serialConnect)
{
if (myPort.available() > 0) {
IncomingSTR = myPort.readStringUntil(lf);
//println (IncomingStr);
if (IncomingSTR != null) {
println (IncomingSTR);
String [] list = split(IncomingSTR, ' ');
if ( list.length >=2 )
{
int Mach_ID= int (list [0]);
int LastUptime= int(list [1]);
println (Mach_ID+ " and " +LastUptime);
println (list [0]);
println (list [1]);
//println ( Dev);
// SaveToFile ();
}
}
} // end of if port available
the int LastUptime always comes as a zero.
While the println (list [1]); is returning the correct integer from ardu.
So simple, I fee stupid, where is the mistake?
Thanks