Nextion library problem in Ardiuno Uno

Hi all,
I am a newbie in arduino. I have a arduino project with nextion HMI. Firstly, i add ITEADLIB_Arduino_Nextion library from github. Then, i write project codes and upload to arduino. After uploading has completed, my arduino's RX led start to blink constantly. I write a simple code with ITEADLIB like ;

#include "Nextion.h"

NexNumber n9 = NexNumber (1, 3, "n9"); 

uint32_t number = 0; 
  
void setup() {
  Serial.begin(9600);
  nexInit();
}

void loop() {
  
  n9.getValue(&number);
  delay(1000);
  Serial.println(number,DEC);

}

i take continiously errors "⸮⸮⸮get n9.val⸮⸮⸮get n9.val⸮⸮⸮get n9.val⸮⸮⸮get n9.val⸮⸮⸮get n9.val⸮⸮⸮ ...." and so on in serial monitor. My arduino has only connected with my computer, nextion HMI isn't connected. Codes are OK, because it works when other computers upload it. Also, codes that i havent used Nextion lib. works smoothly. What is the problem?

Hi, you are using the same serial for display and for serial monitor.
Normally you have to define a software serial.
Have you set up the library file as described here?

thank you Z4KK4, i set up the library as described at hyperlink.Unfortunately, that doesn't work. However, i found that if i change Nexconfig.h file - line 37 to
#include<SoftwareSerial.h>
extern SoftwareSerial HMISerial;
#define nexSerial HMISerial
it works.

good :+1: so, problem solved?

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