Is there a limit to the number of char inputs the Serial can read at one time?
The serial buffer as of Arduino 1.0+ is 64 bytes.
If you're using SoftSerial, only one softserial connection can receive data at a given time.
Serial reads one character at a time from the input.
It places those characters, one at a time, into an input buffer - the size of which depends on the Arduino you are using.
You then read those characters from the input buffer using the Serial.read() function, which returns the characters from the buffer one at a time.
If you want to read more than one at a time you can use the Serial.readBytes(buffer,len) function to read up to “len” characters from the serial buffer into the memory pointer to by “buffer”:
char buf; Serial.readBytes(buf,9);
- that will read 9 bytes into the variable “buf”, leaving room for one extra character for the null-termination for the string.
Okay, I suppose I should have asked how many characters the Serial can hold. It's 64 bytes? Does that come out to about 64 characters?
It's 64 bytes? Does that come out to about 64 characters?
No. It comes out to exactly 64 characters. If using Arduino IDE 1.0+. On older versions, the buffer size was 128 characters.