본문 바로가기
MCU/ESP32

[Arduino IDE] ESP32-S3 Software Serial

by mokhwasomssi 2023. 10. 26.

목표

  • ESP32-S3 Software Serial 1개 적용

배경

UART 총 4개 사용 필요

 

But ESP32-S3는 UART 3개

나머지 1개는 Software Seiral 사용해서 UART 구현

 

데이터 시트 (3/75 pages)


방법

EspSoftwareSerial 라이브러리 설치

라이브러리 다운

https://github.com/plerup/espsoftwareserial/releases

 

Releases · plerup/espsoftwareserial

Implementation of the Arduino software serial for ESP8266 - plerup/espsoftwareserial

github.com

ino 코드

#include <SoftwareSerial.h>

#define MYPORT_TX 11
#define MYPORT_RX 12

EspSoftwareSerial::UART myPort;

void setup() 
{
  Serial.begin(115200); // Standard hardware serial port
  myPort.begin(115200, SWSERIAL_8N1, MYPORT_RX, MYPORT_TX, false);
}

void loop() 
{
  Serial.println("Hareware Seiral");
  myPort.println("Software Serial");
  delay(1000);
}

결과