I have a Esp32 Doit Dev kit v1.
I'm using Visual Studio Code with PlatformIO.
I'm trying to use a Nextion lcd.
My code is
Code: Select all
#include <HardwareSerial.h>
// HardwareSerial NextionSerial(0);
HardwareSerial NextionSerial(2);
void setup() {
// NextionSerial.begin(115200, SERIAL_8N1, 3, 1);
NextionSerial.begin(115200, SERIAL_8N1, 19, 18);
NextionSerial.print("page boot");
NextionSerial.print("\xFF\xFF\xFF");
delay(10);
NextionSerial.print("page boot");
NextionSerial.print("\xFF\xFF\xFF");
delay(500);
NextionSerial.print("page nextion");
NextionSerial.print("\xFF\xFF\xFF");
delay(2000);
NextionSerial.print("page main");
NextionSerial.print("\xFF\xFF\xFF");
}
void loop() {
delay(2000);
}
If I'm using HardwareSerial 0 with lcd on pins (1 and 3), it's working.
What's the problem ?
I thought the board had 3 uart serials.