Go Down

Topic: serial communication problem (Read 1 time) previous topic - next topic


Why the ">=0"?

Because indexOf() returns the offset from the beginning of the String to the searched for string. The searched for string could be at the start of the searched String, so offset would be 0. It could be somewhere else, so offset would be > 0. It could not exist, so offset would be -1.


Why the ">=0"?

In this case it is copy/paste carryover from serial code that does not use a delimiter. You should be able to remove it if desired.
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.


thank you for the help and info

Go Up