Start a new topic

myNextion error

every example code that has myNextion in the loop,

i get error saying "myNextion not declared in this scope. I have tried to figure out how to fix this, but nothing seems to be working

can anyone help?

i'm running a nextion with arduino mega


Any code you see with Nextion myNextion and ffff ffff ffff is not the IteadLib.

So to avoid such errors,

- use code that works for the library you are using.

What library would it be in?

Two guys created an HMI project about two years ago

To handle just the basics of their specific HMI they created their supporting code.

With it called Nextion.h, well many take it as being a library.

These two authors of that project do not answer questions to support their code.

(It would be equivalent of you making a post, and others using pieces of your code)


Nextion in the last year has expanded greatly going through many recent changes.

So the IteadLIb Arduino Nextion Library has added many new Components/Functions


The basics of communicating with the Nextion is still text based instructions

page0.t0="Hello Word"ÿÿÿ  and touch 0x65 return codes

As a simple text command over serial, a "library" is not needed per se, one can create

their own code specific to their needs, in their desired programming language.


So in saying that, support for the given library should come from the authors of the lib.

Itead has published the IteadLib Arduino Nextion Library

as such, I have familiarized myself with it to help answer questions about it

(before this - my code was in either mikro-Pascal for STMs or Kylix for Intel Edisons)

But I am certainly not going to attempt becoming familiar with all libs that exist.


So Nextion myNextion is not in the IteadLib,

one should perhaps ask the authors - which is usually included in the code.


IteadLib can be identified by various formatting styles

 - nexInit() in setup();

 - nexLoop(nex_listen_list); in loop;

 - NexTouch *nex_listen_list[] = { &b0, NULL};

 - components that start with NexComponent such as

   NexText t0 = NexText(0, 2, "t0"); and

   NexDSButton bt0 = NexDSButton(0, 1, "bt0");

- and the use of .attachPush and .attachPop for touch functions such as

   bt0.attachPop(bt0PopCallback, &bt0);


The IteadLib Arduino Nextion Library can be found at their github

https://github.com/itead/ITEADLIB_Arduino_Nextion


Login or Signup to post a comment