I am receiving 3 different strings and I print them separately based on the first char.
All is well till I tried to parse one of strings by token. The newly formed strings will print out but will not show as text . I get a null pointer.
Please help.
if (BTPort.available() > 0) {
IncomingStr = BTPort.readStringUntil(lf);
if (IncomingStr != null) {
First = IncomingStr.charAt(0);
// println(IncomingStr);
// println(First);
if (First == 'M')
Incoming_Currents_A = IncomingStr; // incoming current string from teensy
else if (First == 'E')
{//Incoming_Encs_A= splitTokens(IncomingStr, "B "); // incoming current string from teensy
Incoming_Encs = splitTokens(IncomingStr, "B");
//println (Incoming_Encs[0]);
}
else
Incoming_Info= IncomingStr; // incoming current string from teensy
}
}
fill(g);
text (Incoming_Encs[0], 10, 1000);
text (Incoming_Encs[1], 400, 1000);
text (Incoming_Currents_A, 10, 1040);
text (Incoming_Info , 10, 1080);
please format code with </> button * homework policy * asking questions