himmelsteht:
It's a simple matter. The arduino waits for the start string as follows:while (Serial.available() == 0){
};
while(Serial.available()){
while (!(b==Serial.readString())){
}
}
Anyone have any ideas? How is processing sending out it's strings? Must be an issue of a hidden delimiter.
Yes. Your code assumes that when the first char arrives, the rest will be available by the time that while loop comes around for them.
Little bit of reality here:
--- serial chars arrive at baud rate /10 per second. 115200 serial can send chars just under 89 microseconds apart, quick, right?
--- 16MHz Arduino runs 1388 clock cycles in the same time. It can do other things while waiting for data the same way you can do things while waiting for lunch. But it can't make serial chars arrive faster and your while loop ends when no char is available and those 1388 cycles are nothing in the face of blocking code, certainly can't be used for other tasks.
Next you learn to collect chars as they come and only evaluate once the last one has been collected.
PS, don't use String variables on Arduino if you can help it. They're hard on the heap.