Erro ao usar nextion com arduino

Olá, estou a obter um erro ao declarar os botões do nextion.

Esse é o único código de nextion que tenho.

Obrigado pela ajuda!

CÓDIGO:

#include "Nextion.h"


NexButton b0 = NexButton(0,2,"b0");
NexButton b1 = NexButton(0,3,"b1");
NexText t0 = NexText(0,4,"t0");

ERRO:

Arduino: 1.8.13 Hourly Build 2020/04/27 05:33 (Windows 10), Placa:"Arduino Uno"

In file included from C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.h:18:0,

from C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:15:

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp: In function 'bool recvRetNumber(uint32_t*, uint32_t)':

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: error: 'Serial2' was not declared in this scope

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:55:5: note: in expansion of macro 'nexSerial'

nexSerial.setTimeout(timeout);

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: note: suggested alternative: 'Serial'

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:55:5: note: in expansion of macro 'nexSerial'

nexSerial.setTimeout(timeout);

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp: In function 'uint16_t recvRetString(char*, uint16_t, uint32_t)':

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: error: 'Serial2' was not declared in this scope

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:114:16: note: in expansion of macro 'nexSerial'

while (nexSerial.available())

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: note: suggested alternative: 'Serial'

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:114:16: note: in expansion of macro 'nexSerial'

while (nexSerial.available())

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp: In function 'void sendCommand(const char*)':

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: error: 'Serial2' was not declared in this scope

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:166:12: note: in expansion of macro 'nexSerial'

while (nexSerial.available())

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: note: suggested alternative: 'Serial'

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:166:12: note: in expansion of macro 'nexSerial'

while (nexSerial.available())

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: error: 'Serial2' was not declared in this scope

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:171:5: note: in expansion of macro 'nexSerial'

nexSerial.print(cmd);

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: note: suggested alternative: 'Serial'

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:171:5: note: in expansion of macro 'nexSerial'

nexSerial.print(cmd);

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp: In function 'bool recvRetCommandFinished(uint32_t)':

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: error: 'Serial2' was not declared in this scope

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:192:5: note: in expansion of macro 'nexSerial'

nexSerial.setTimeout(timeout);

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: note: suggested alternative: 'Serial'

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:192:5: note: in expansion of macro 'nexSerial'

nexSerial.setTimeout(timeout);

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp: In function 'bool nexInit()':

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: error: 'Serial2' was not declared in this scope

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:226:5: note: in expansion of macro 'nexSerial'

nexSerial.begin(9600);

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: note: suggested alternative: 'Serial'

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:226:5: note: in expansion of macro 'nexSerial'

nexSerial.begin(9600);

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp: In function 'void nexLoop(NexTouch**)':

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: error: 'Serial2' was not declared in this scope

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:242:12: note: in expansion of macro 'nexSerial'

while (nexSerial.available() > 0)

^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: note: suggested alternative: 'Serial'

#define nexSerial Serial2

^

C:\Program Files (x86)\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:242:12: note: in expansion of macro 'nexSerial'

while (nexSerial.available() > 0)

^~~~~~~~~

exit status 1
Erro ao compilar para a placa Arduino Uno.

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