Im trying to use a nextion display with my lora esp32 TTGO (combined board) but I can't seem to send data to the display via serial as i am trying to do with the tx two different pins. Communication works though as i can get this display to talk to a regular arduino board via tx so im perplexed as to why the esp32 lora board can't. I am thinking i must be missing something with how you are supposed to use the nextion displays with esp32s. Just making this post in case someone knows what i'm missing. included is the entirety of my code at the moment.
int variable1 = 0; // This is a simple variable to keep increasing a number to have something dynamic to show on the display.
void setup() { // Put your setup code here, to run once:
Serial.begin(9600); // Start serial comunication at baud=9600. For Arduino mega you would have to add a
// number (example: "Serial1.begin(9600);").
// If you use an Arduino mega, you have to also edit everything on this sketch that
// says "Serial" and replace it with "Serial1" (or whatever number you are using).
} // End of setup
void loop() { // Put your main code here, to run repeatedly:
variable1++; // Increase the value of the variable by 1.
if(variable1 == 201){ // If the variable reach 201...
variable1 = 0; // Set the variable to 0 so it starts over again.
}
// We are going to send the variable value to the object called n0:
// After the name of the object you need to put the dot val because val is the atribute we want to change on that object.
Serial.print("n0.val="); // This is sent to the nextion display to set what object name (before the dot) and what atribute (after the dot) are you going to change.
Serial.print(variable1); // This is the value you want to send to that object and atribute mention before.
Serial.write(0xff); // We always have to send this three lines after each command sent to the nextion display.
Serial.write(0xff);
Serial.write(0xff);
delay(100);
} // End of loop