# Module arduboy_rust::prelude::serial

source ·
Expand description

This is the Module to interact in a save way with the Arduino Serial C++ library.

You will need to uncomment the Arduino_Serial_Library in the import_config.h file.

## Traits

- Serialprintable
- Serialprintlnable

## Functions

- available
  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).
- begin
  Sets the data rate in bits per second (baud) for serial data transmission. For communicating with Serial Monitor, make sure to use one of the baud rates listed in the menu at the bottom right corner of its screen. You can, however, specify other rates - for example, to communicate over pins 0 and 1 with a component that requires a particular baud rate.
- end
  Disables serial communication, allowing the RX and TX pins to be used for general input and output. To re-enable serial communication, call begin().
- print
  The Arduino Serial Print class is available for writing text to the screen buffer.
- println
  The Arduino Serial Print class is available for writing text to the screen buffer.
- read
  Reads incoming serial data. Use only inside of available():
- read_as_utf8_str
  Reads incoming serial data.