Demo 2 - How To Use Multiple Serial Ports On Arduino ESP32 - IoT Sharing PDF
Demo 2 - How To Use Multiple Serial Ports On Arduino ESP32 - IoT Sharing PDF
IOTSHARING DOTCOM
ESP32
NO COMMENTS
1. Introduction
Arduino ESP32 use Serial port to flash software and print information on Terminal. ESP32 supports 3
Serial ports so you need not to use SoftwareSerial as in general Arduino. In this tutorial we only care
about using How to use multiple Serial port on Arduino ESP32 to print the debug information to
Terminal.
2. Hardware
You do not need any extra hardware.
3. Software
We use "HardwareSerial" class for Serial communication. It has some important interfaces:
- HardwareSerial(int uart_nr): this is the constructor of HardwareSerial where uart_nr is 0, 1 or 2 so we
have maximum 3 Serial ports.
- available(): Get the number of bytes (characters) available for reading from the serial port.
- print(): Prints data to the serial port as human-readable ASCII text.
- println(): Prints data to the serial port as human-readable ASCII text followed by a carriage return
character (ASCII 13, or '\r') and a newline character (ASCII 10, or '\n').
http://www.iotsharing.com/2017/05/how-to-use-serial-arduino-esp32-print-debug.html 1/2
27/1/2019 Demo 2: How to use multiple Serial ports on Arduino ESP32 ~ IoT Sharing
Related Posts:
http://www.iotsharing.com/2017/05/how-to-use-serial-arduino-esp32-print-debug.html 2/2