Study for the Internet of Things (IOT102) Test. Access comprehensive flashcards and multiple choice questions, each with hints and explanations. Get prepared for your exam!

Multiple Choice

Which situation triggers the serialEvent() interrupt?

serialEvent() runs when new data arrives on the serial input. When bytes come in from the serial line, they’re placed in the receive buffer and the function is triggered so you can read them (typically by checking Serial.available() and then Serial.read()). It isn’t triggered by sending data out, by powering the board, or by a port shutting down. So the best description is that it fires when data comes from the serial port.

serialEvent() runs when new data arrives on the serial input. When bytes come in from the serial line, they’re placed in the receive buffer and the function is triggered so you can read them (typically by checking Serial.available() and then Serial.read()). It isn’t triggered by sending data out, by powering the board, or by a port shutting down. So the best description is that it fires when data comes from the serial port.