I'm trying to upload an example from nextion folder to my arduino.
but it comes with this error.
Arduino: 1.6.8 (Windows 7), Board: "Arduino Nano, ATmega328"
CompPage:19: error: 'NexPage' does not name a type
NexPage page0 = NexPage(0, 0, "page0");
^
CompPage:20: error: 'NexPage' does not name a type
NexPage page1 = NexPage(1, 0, "page1");
^
CompPage:21: error: 'NexPage' does not name a type
NexPage page2 = NexPage(2, 0, "page2");
^
CompPage:22: error: 'NexPage' does not name a type
NexPage page3 = NexPage(3, 0, "page3");
^
CompPage:24: error: 'NexTouch' does not name a type
NexTouch *nex_listen_list[] =
^
C:\Users\Uno\Desktop\ITEADLIB_Arduino_Nextion-master\examples\CompPage\CompPage.ino: In function 'void page0PopCallback(void*)':
CompPage:35: error: 'dbSerialPrintln' was not declared in this scope
dbSerialPrintln("page0PopCallback");
^
CompPage:36: error: 'page1' was not declared in this scope
page1.show();
^
C:\Users\Uno\Desktop\ITEADLIB_Arduino_Nextion-master\examples\CompPage\CompPage.ino: In function 'void page1PopCallback(void*)':
CompPage:41: error: 'dbSerialPrintln' was not declared in this scope
dbSerialPrintln("page1PopCallback");
^
CompPage:42: error: 'page2' was not declared in this scope
page2.show();
^
C:\Users\Uno\Desktop\ITEADLIB_Arduino_Nextion-master\examples\CompPage\CompPage.ino: In function 'void page2PopCallback(void*)':
CompPage:47: error: 'dbSerialPrintln' was not declared in this scope
dbSerialPrintln("page2PopCallback");
^
CompPage:48: error: 'page3' was not declared in this scope
page3.show();
^
C:\Users\Uno\Desktop\ITEADLIB_Arduino_Nextion-master\examples\CompPage\CompPage.ino: In function 'void page3PopCallback(void*)':
CompPage:53: error: 'dbSerialPrintln' was not declared in this scope
dbSerialPrintln("page3PopCallback");
^
CompPage:54: error: 'page0' was not declared in this scope
page0.show();
^
C:\Users\Uno\Desktop\ITEADLIB_Arduino_Nextion-master\examples\CompPage\CompPage.ino: In function 'void setup()':
CompPage:59: error: 'nexInit' was not declared in this scope
nexInit();
^
CompPage:60: error: 'dbSerialPrintln' was not declared in this scope
dbSerialPrintln("setup begin");
^
CompPage:62: error: 'page0' was not declared in this scope
page0.attachPop(page0PopCallback);
^
CompPage:63: error: 'page1' was not declared in this scope
page1.attachPop(page1PopCallback);
^
CompPage:64: error: 'page2' was not declared in this scope
page2.attachPop(page2PopCallback);
^
CompPage:65: error: 'page3' was not declared in this scope
page3.attachPop(page3PopCallback);
^
C:\Users\Uno\Desktop\ITEADLIB_Arduino_Nextion-master\examples\CompPage\CompPage.ino: In function 'void loop()':
CompPage:72: error: 'nex_listen_list' was not declared in this scope
nexLoop(nex_listen_list);
^
CompPage:72: error: 'nexLoop' was not declared in this scope
nexLoop(nex_listen_list);
^
Multiple libraries were found for "Nextion.h"
Used: C:\Users\Uno\Documents\Arduino\libraries\NeoNextion
Not used: C:\Users\Uno\Documents\Arduino\libraries\nextion-master
Not used: C:\Users\Uno\Documents\Arduino\libraries\ITEADLIB_Arduino_Nextion-master
Not used: C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-0.7.0
exit status 1
'NexPage' does not name a type
Invalid library found in C:\Program Files (x86)\Arduino\libraries\nextion-master: C:\Program Files (x86)\Arduino\libraries\nextion-master
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
This is the arduino example code:
#include "Nextion.h"
NexPage page0 = NexPage(0, 0, "page0");
NexPage page1 = NexPage(1, 0, "page1");
NexPage page2 = NexPage(2, 0, "page2");
NexPage page3 = NexPage(3, 0, "page3");
NexTouch *nex_listen_list[] =
{
&page0,
&page1,
&page2,
&page3,
NULL
};
void page0PopCallback(void *ptr)
{
dbSerialPrintln("page0PopCallback");
page1.show();
}
void page1PopCallback(void *ptr)
{
dbSerialPrintln("page1PopCallback");
page2.show();
}
void page2PopCallback(void *ptr)
{
dbSerialPrintln("page2PopCallback");
page3.show();
}
void page3PopCallback(void *ptr)
{
dbSerialPrintln("page3PopCallback");
page0.show();
}
void setup(void)
{
nexInit();
dbSerialPrintln("setup begin");
page0.attachPop(page0PopCallback);
page1.attachPop(page1PopCallback);
page2.attachPop(page2PopCallback);
page3.attachPop(page3PopCallback);
dbSerialPrintln("setup end");
}
void loop(void)
{
nexLoop(nex_listen_list);
}