Nextion display not interacting /working with arduino UNO

Hi and Help me please (I'm fairly new to arduino).

I'm using this video (link below) to try to get a hold of the nextion 2.8" basic model display.

YOUTUBE LINK

I'm using it without the Nextion.h file and I'm downloading the nextion TFT file via microSD card to the display

Using the nextion editor is working and i'm doing the same as in the video (except I have 3 buttons instead of 5)

the display looks like I made it in the editor, but when I push the buttons nothing is printed on the serial monitor (except "hallo world).

What am I doing different/ wrong:

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600); 
  Serial.println ("hallo world");
}

void loop() {
  // put your main code here, to run repeatedly:
  if (Serial.available()){
  String data_from_display="";
  delay(30);
  while(Serial.available()){
   data_from_display += char(Serial.read());
  }
  Serial.println(data_from_display);
  sendData(data_from_display);
  }
 }
 
void sendData(String data_from_display){
  if(data_from_display == "ON"){
    Serial.println("on"); 
  }
  if(data_from_display == "OFF"){
    Serial.println("off");
  }
     if(data_from_display == "MAIN"){
    Serial.write("Main");
  }
}

I'm using the arduino uno and I do have a stable 5V supply to the display. And ofc this connection between the two:
image

But my serial port... there is no action when I push the buttons :frowning: Only shows "hallo world".

How can I make the connection work? Please Help!

The serial port on a Uno is already in use for the USB connection to your PC, so by connecting a Nextion to the serial port (0 and 1) you are trying to do 2 different things with the serial port. I'm not saying it can't be done but it makes things more difficult than they need to be. I suggest a Mega or Nano Every, or indeed any Arduino board with a spare hardware serial port.

Also, read this: Using Nextion displays with Arduino

But I have tried with the Mega as well. There is no communication
:sob:

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