What is the serial monitor actually doing?

PaulS:

Hmmm, I changed this:
while(mySerial.available() == 0);

to this:
while(mySerial.available() <= 0);

That change had no affect at all, since the available() function returns the number of bytes in the buffer, and there can not be fewer than 0 bytes in the buffer.

yep, you're right. Since I was unplugging the device each time to program it, i had to plug it in at the right time in order for the display to process the data correctly. Needless to say, that produced some randomness in the 'results'. Once I determined that the device was operating with some consistency, I was able to write a few more things, so now I don't have to unplug it, and there is much less randomness in the display output :smiley:

PaulS:

I don't know what the other junk is. Is it normal for devices like this to spit out junk data like that?

Normally, devices do not spit out random junk. The data means something, even if that is not apparent to you. Try printing a space after each value, so you can see where the values break. 6655 could be 6, 6, 5, 5 or 66, 5, 5, or 6, 65, 5, or 665, 5, or a number of other combinations.

I know you saw this, but for anyone else who is watching, this discussion is becoming more and more about the logic and composition of the code. As such, I started a new thread here: http://arduino.cc/forum/index.php/topic,106427.0.html