According to the manual:
https://www.arduino.cc/en/Reference/StringTrim
Trim strips one or more whitespaces from the beginning and the end. Does it also removes tabulators and \n ?
I have the following code which works:
while (Serial.available()) { // something came across the serial
char c = (char)Serial.read();
Command += c;
Command.trim();
if (c=='\n')
{
Complete =true;
}
if (Command.length() >0 && Complete) {
if (Command == "LED_ON") {
// Do stuff
}
Although I'm not sure that it is working because of the last if statement which says: if (Command == "LED_ON") ignores the ending \n and say ok it matched OR Command.trim() really takes off that \n.
Thank you