Here is the syntax for the readBytes() function:
Syntax
Serial.readBytes(buffer, length)
Parameters
Serial
: serial port object. See the list of available serial ports for each board on the Serial main page.
buffer
: the buffer to store the bytes in. Allowed data types: array of char
or byte
.
length
: the number of bytes to read. Allowed data types: int
.
The recieve variable is not array.
Better ways (non blocking) to read from the serial port are covered in the serial input basics tutorial.