Go Down

Topic: serial communication problem (Read 983 times) 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

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131