pub fn available() -> i16
Expand description

Get the number of bytes (characters) available for reading from the serial port. This is data that’s already arrived and stored in the serial receive buffer (which holds 64 bytes).

Example

use arduboy_rust::prelude::*;
if serial::available() > 0 {
    // read the incoming byte:
    let incoming_byte = serial::read();

    // say what you got:
    serial::print("I received: ");
    serial::println(incoming_byte);
}