Serial.readString() is a blocking function with a timeout.
Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.
The technique in the 3rd example will be the most reliable.
You can send data in a compatible format with code like this - you can get the same effect in any programming language
Robin2:
Serial.readString() is a blocking function with a timeout.
Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.
The technique in the 3rd example will be the most reliable.
You can send data in a compatible format with code like this - you can get the same effect in any programming language
Serial.print('<'); // start marker
Serial.print(value1);
Serial.print(','); // comma separator
Serial.print(value2);
Serial.println('>'); // end marker
There is no added value in sending "K01_ON" rather than just 'N' for ON and sending a single character will make the Arduino code simpler.
There is [this clever idea](https://forum.arduino.cc/index.php?topic=573423.msg3906953#msg3906953) if you just want to check for single characters.
...R
i cant use single character because im planning to control more than 10 Output separately
Robin2:
At last count there were over 60 human readable ASCII characters, and there are 255 in total.
...R
now temporary i change using character as advise...its working perfectly.
for string matter just easier for me reference for future and arrange which output etc if compare character that hard to refer.