if available() gets the number of bytes arrived and stored in the serial recieve buffer, how come the result of the code bellow is just printing.
(when i lunch the program, the result on the serial monitor is: printprintprintprintprint....)
char inByte = 0;
void setup (){
Serial.begin(9600);
}
void loop ()
{
Serial.print("print");
while (Serial.available()>0){
inByte = Serial.read();
Serial.print(inByte);
}
}
What should i do program to stop after serial.print("print")
(print and then wait till you recieve at least 1 byte)
thank you very much