mirror of
https://github.com/itead/ITEADLIB_Arduino_Nextion.git
synced 2026-03-13 05:26:52 +01:00
@@ -22,6 +22,9 @@
|
||||
/* define serial for debug */
|
||||
#define dbSerial Serial
|
||||
|
||||
/* define serial for communicate with Nextion screen */
|
||||
#define nexSerial Serial2
|
||||
|
||||
#ifdef DEBUG_SERIAL_ENABLE
|
||||
#define dbSerialPrint(a) dbSerial.print(a)
|
||||
#define dbSerialPrintln(a) dbSerial.println(a)
|
||||
@@ -32,7 +35,4 @@
|
||||
#define dbSerialBegin(a)
|
||||
#endif
|
||||
|
||||
/* define serial for communicate with Nextion screen */
|
||||
#define nexSerial Serial2
|
||||
|
||||
#endif
|
||||
|
||||
@@ -403,6 +403,7 @@ bool NexTouch::getBrightness(uint32_t *brightness)
|
||||
*/
|
||||
bool nexInit(void)
|
||||
{
|
||||
dbSerialBegin(9600);
|
||||
nexSerial.begin(9600);
|
||||
NexTouch::sendCommand("");
|
||||
NexTouch::sendCommand("page 0");
|
||||
|
||||
@@ -45,8 +45,7 @@ void b0PopCallback(void *ptr)
|
||||
}
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
dbSerialBegin(9600);
|
||||
{
|
||||
nexInit();
|
||||
b0.attachPop(b0PopCallback, &b0);
|
||||
dbSerialPrintln("setup done");
|
||||
|
||||
@@ -39,7 +39,6 @@ void q0PopCallback(void *ptr)
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
dbSerialBegin(9600);
|
||||
nexInit();
|
||||
q0.attachPop(q0PopCallback);
|
||||
dbSerialPrintln("setup done");
|
||||
|
||||
@@ -55,7 +55,6 @@ void hot1PopCallback(void *ptr)
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
dbSerialBegin(9600);
|
||||
nexInit();
|
||||
hot0.attachPush(hot0PushCallback, &hot0);
|
||||
hot0.attachPop(hot0PopCallback, &hot0);
|
||||
|
||||
@@ -55,7 +55,6 @@ void page3PopCallback(void *ptr)
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
dbSerialBegin(9600);
|
||||
nexInit();
|
||||
dbSerialPrintln("setup begin");
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ void p0PopCallback(void *ptr)
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
dbSerialBegin(9600);
|
||||
nexInit();
|
||||
p0.attachPop(p0PopCallback);
|
||||
dbSerialPrintln("setup done");
|
||||
|
||||
@@ -61,7 +61,6 @@ void buttonDownPopCallback(void *ptr)
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
dbSerialBegin(9600);
|
||||
nexInit();
|
||||
btn_up.attachPop(buttonUpPopCallback);
|
||||
btn_down.attachPop(buttonDownPopCallback);
|
||||
|
||||
@@ -61,9 +61,6 @@ void buttonDownPopCallback(void *ptr)
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
uint32_t brightness = 0;
|
||||
|
||||
dbSerialBegin(9600);
|
||||
nexInit();
|
||||
btn_up.attachPop(buttonUpPopCallback);
|
||||
btn_down.attachPop(buttonDownPopCallback);
|
||||
|
||||
@@ -80,7 +80,6 @@ void b1PopCallback(void *ptr)
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
dbSerialBegin(9600);
|
||||
nexInit();
|
||||
dbSerialPrintln("setup done");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user