Start a new topic

my Nextion and RX2 issues

Arduino: 1.8.1 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

 

sketch_BOB1:17: error: 'RX2' was not declared in this scope

 

 SoftwareSerial Nextion(RX2, TX2);

 

                        ^

 

sketch_BOB1:17: error: 'TX2' was not declared in this scope

 

 SoftwareSerial Nextion(RX2, TX2);

 

                             ^

 

sketch_BOB1:18: error: 'Nextion' does not name a type

 

 Nextion myNextion(nextion, 9600);

 

 ^

 

C:\Users\daron\Desktop\sketch_BOB1\sketch_BOB1.ino: In function 'void setup()':

 

sketch_BOB1:36: error: 'myNextion' was not declared in this scope

 

   myNextion.int();

 

   ^

 

sketch_BOB1:36: error: expected unqualified-id before 'int'

 

   myNextion.int();

 

             ^

 

C:\Users\daron\Desktop\sketch_BOB1\sketch_BOB1.ino: In function 'void loop()':

 

sketch_BOB1:54: error: 'myNextion' was not declared in this scope

 

 String message = myNextion.listen();

 

                  ^

 

exit status 1

'RX2' was not declared in this scope

 

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.



Whose library?

wrong Forum?

 

I downloaded ITEAD Library to my Arduino Libraries. I added ITEAD Library to my project. All Libraries loaded to my sketch, so i deleted all except Nextion.h. I read from Nextion, to connect my Nextion display to my Arduino Mega2560, i use TX(Nextion) to RX2(Arduino) and RX(Nextion) to TX2(Arduino)
I posted error message from my Arduino Sketch as seen above.
My sketch is not complete. would that make a difference ?

IteadLib Arduino Nextion Library doesn't use Software Serial when the Mega has 4 very good Hardware Serial modules.  Use the Search bar above for * Arduino Nextion Examples.  Iteadlib is by default configured for RX2/TX2  Serial2, so if you don't want to make changes - plug Nextion into RX2/TX2.  Follow a few of the Examples with paired HMI and ino files.

Login or Signup to post a comment