PeterH:
zoomkat:
delay(2); //delay to allow byte to arrive in input bufferCould you explain why you're doing this?
Quite simple. The delay slows down the checking of the arduino serial input buffer such that the buffer isn't checked for content prior to another byte of the string sent being available.