Error:conflicting declaration 'using SoftwareSerial = using UART =class EspSoftwareSerial::BasicUART<EspSoftwareSerial::GpioCapabilities>'>

I'm using Arduino IDE to proglam M5stack. When I trying to use ESPSoftwareSerial library,the error written in the title has occurred.
Full text of error is

C:\Users\ts200\Arduino Document\libralies\EspSoftwareSerial.h:432:47 error:conflicting declaration 'using SoftwareSerial = using UART =class EspSoftwareSerial::BasicUART<EspSoftwareSerial::GpioCapabilities>'>

using SoftwareSerial = EspSoftwareSerial::UART;
                                              ^

I'm using the board manager 'm5stack_core_esp32'.
I haven't rewritten any libraries.
Here is the sketch I tried to run.But evenafter deleting the contents of the setup function and loop function,the same error occurred.


#include<M5Stack.h>
#include<SoftwareSerial.h>

SoftwareSerial myserial(17, 16);


void setup()
{
  Serial.begin(115200);
  // Power ON Stabilizing...
  delay(500);
  M5.begin();

  M5.Lcd.setTextColor(GREEN);
  M5.Lcd.setTextSize(4);
  M5.Lcd.clear(BLACK);
}

void loop() {
  M5.update();
  if (M5.BtnA.wasPressed())
  {
 
    M5.Lcd.clear(BLACK);
    M5.Lcd.setCursor(0, 0);
    M5.Lcd.println("POWER ON");
  }
  if (M5.BtnB.wasPressed())
  {
 
    M5.Lcd.clear(BLACK);
    M5.Lcd.setCursor(0, 0);
    M5.Lcd.println("POWER OFF");
  }
}

I want to know how to fix this error.
I would appreciate any help, thank you.

Not sure what it's complaining about but here's what I'm doing on an ESP32 based display board
Can you use pins 17 & 18 instead? Those can be used as hardware serial port.

const int RX_PIN = 17;
const int TX_PIN = 18;

void setup() 
{
    Serial.begin(115200);
    setupUI();

    Serial2.begin(9600, SERIAL_8N1, RX_PIN, TX_PIN);
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.