You have the `Serial`, `Serial1`, `Serial2`, `Serial3` objects available when you write code for the

You have the
Serial
,
Serial1
,
Serial2
,
Serial3
objects available when you write code for the Mega. While you previously had to do code-quoted to create a software serial object to talk to the ESP, you instead reference your hardware serial object directly. So code like
esp8266.println("AT+...");

simply becomes

Serial1.println("AT+...");

and the data is then sent out via the TX1 pin. Conversely,
Serial1.read()
would try and read data incoming on RX1.
Was this page helpful?