I am using Arduino Duemilanove to run some tests. I communicate with arduin through the serial port. Everything that I try to do is read in several ints, and I use the parseInt () function for my simplicity.
My question is, is there a way to program ardunino to echo each character when it is entered, but still using the parseInt () function?
I know that there are usually options for enabling local echo in terminal clients, but I would rather not rely on them.
Here is the code I'm using:
unsigned int timeTotal;
Serial.print("Enter Total Time of Period (ms): ");
while (!Serial.available()) { ; }
while (Serial.available() > 0) {
timeTotal = Serial.parseInt();
Serial.read();
Serial.println();
Serial.print("Total Time: ");
Serial.println(timeTotal, DEC);
}
as you can see, I tried to use peek (), but only get one character from me ....
Thanks in advance!
MRT89 source
share