Serial.available() returns the number of bytes available for reading in the buffer.
int nBytes=Serial.available();
if (nBytes > x) {
............
............
............
}
Serial.available() returns the number of bytes available for reading in the buffer.
int nBytes=Serial.available();
if (nBytes > x) {
............
............
............
}