I'm working on an arduino mega and I'm trying to read the serial buffer after I filled it up from the serial Monitor.
I read that the buffer size is 128 bytes, but what I get from the serial.available() is just 49 characters. Anyone know why this is happening?
Using "delay" for one tenth of a second is a waste of processor power, and specifying delays like this depends on different factors.
Much better to monitor "available" until enough data has been received to proceed.
As a simple rule-of-thumb, at 9600 baud, one character takes a little over 1ms to transmit.