diff --git a/NexSerialConfig.h b/NexSerialConfig.h index b98e78a..8efb218 100644 --- a/NexSerialConfig.h +++ b/NexSerialConfig.h @@ -17,18 +17,22 @@ #define __NexSerialConfig_H__ /*enable debug serial*/ -#define DEBUG_SERIAL_ENABLE +#define DEBUG_SERIAL_ENABLE + +/*define serial for debug*/ +#define dbSerial Serial #ifdef DEBUG_SERIAL_ENABLE -#define dbSerialPrint(a) Serial.print(a) -#define dbSerialPrintln(a) Serial.println(a) -#define dbSerialBegin(a) Serial.begin(a) +#define dbSerialPrint(a) dbSerial.print(a) +#define dbSerialPrintln(a) dbSerial.println(a) +#define dbSerialBegin(a) dbSerial.begin(a) #else #define dbSerialPrint(a) #define dbSerialPrintln(a) #define dbSerialBegin(a) #endif -/*Define Nextion serial*/ +/*define serial for communicate with Nextion screen*/ #define nexSerial Serial2 + #endif diff --git a/doc/API-html/_comp_button_8ino-example.html b/doc/API-html/_comp_button_8ino-example.html index a995ac7..0c8b425 100644 --- a/doc/API-html/_comp_button_8ino-example.html +++ b/doc/API-html/_comp_button_8ino-example.html @@ -65,11 +65,9 @@ This program is free software; you can redistribute it and/or modify it under th
uint16_t len;
uint16_t number;
NexButton *btn = (NexButton *)ptr;
-
-
dbSerial.println("b0PopCallback");
-
dbSerial.print("ptr=");
-
dbSerial.println((uint32_t)ptr);
-
+
dbSerialPrintln("b0PopCallback");
+
dbSerialPrint("ptr=");
+
dbSerialPrintln((uint32_t)ptr);
memset(buffer, 0, sizeof(buffer));
btn->getText(buffer, sizeof(buffer));
@@ -83,22 +81,22 @@ This program is free software; you can redistribute it and/or modify it under th
}
void setup(void)
-
{
-
dbSerial.begin(9600);
+
{
+
dbSerialBegin(9600);
nexInit();
b0.attachPop(b0PopCallback, &b0);
-
dbSerial.println("setup done");
+
dbSerialPrintln("setup done");
}
void loop(void)
-
{
-
dbSerial.println("nexLoop");
+
{
+
dbSerialPrintln("nexLoop");
nexLoop(nexListenList);
}
diff --git a/doc/API-html/_comp_button_8ino_source.html b/doc/API-html/_comp_button_8ino_source.html index 787f387..4ac7041 100644 --- a/doc/API-html/_comp_button_8ino_source.html +++ b/doc/API-html/_comp_button_8ino_source.html @@ -70,48 +70,46 @@
29  uint16_t len;
30  uint16_t number;
31  NexButton *btn = (NexButton *)ptr;
-
32 
-
33  dbSerial.println("b0PopCallback");
-
34  dbSerial.print("ptr=");
-
35  dbSerial.println((uint32_t)ptr);
-
36 
-
37  memset(buffer, 0, sizeof(buffer));
-
38  btn->getText(buffer, sizeof(buffer));
-
39 
-
40  number = atoi(buffer);
-
41  number += 1;
-
42 
-
43  memset(buffer, 0, sizeof(buffer));
-
44  itoa(number, buffer, 10);
-
45 
-
46  btn->setText(buffer);
-
47 }
-
48 
-
49 void setup(void)
-
50 {
-
51  dbSerial.begin(9600);
-
52  nexInit();
-
53  b0.attachPop(b0PopCallback, &b0);
-
54  dbSerial.println("setup done");
-
55 }
-
56 
-
57 void loop(void)
-
58 {
-
59  dbSerial.println("nexLoop");
-
60  nexLoop(nexListenList);
-
61 }
+
32  dbSerialPrintln("b0PopCallback");
+
33  dbSerialPrint("ptr=");
+
34  dbSerialPrintln((uint32_t)ptr);
+
35  memset(buffer, 0, sizeof(buffer));
+
36  btn->getText(buffer, sizeof(buffer));
+
37 
+
38  number = atoi(buffer);
+
39  number += 1;
+
40 
+
41  memset(buffer, 0, sizeof(buffer));
+
42  itoa(number, buffer, 10);
+
43 
+
44  btn->setText(buffer);
+
45 }
+
46 
+
47 void setup(void)
+
48 {
+
49  dbSerialBegin(9600);
+
50  nexInit();
+
51  b0.attachPop(b0PopCallback, &b0);
+
52  dbSerialPrintln("setup done");
+
53 }
+
54 
+
55 void loop(void)
+
56 {
+
57  dbSerialPrintln("nexLoop");
+
58  nexLoop(nexListenList);
+
59 }
NexButton::getText
uint16_t getText(char *buffer, uint16_t len)
Get text value from button component.
Definition: NexButton.cpp:35
-
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:423
+
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:409
NexButton.h
API of NexButton.
-
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
+
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:425
NexButton::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register button pop callback function.
Definition: NexButton.cpp:70
NexButton
NexButton,subclass of NexTouch,provides simple methods to control button component.
Definition: NexButton.h:25
NexButton::setText
bool setText(const char *buffer)
Set text value of button component.
Definition: NexButton.cpp:53
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_comp_hotspot_8ino-example.html b/doc/API-html/_comp_hotspot_8ino-example.html index 204d301..1533ea8 100644 --- a/doc/API-html/_comp_hotspot_8ino-example.html +++ b/doc/API-html/_comp_hotspot_8ino-example.html @@ -63,52 +63,52 @@ This program is free software; you can redistribute it and/or modify it under th
void hot0PushCallback(void *ptr)
{
-
dbSerial.println("hot0PushCallback");
-
dbSerial.print("ptr=");
-
dbSerial.println((uint32_t)ptr);
+
dbSerialPrintln("hot0PushCallback");
+
dbSerialPrint("ptr=");
+
dbSerialPrintln((uint32_t)ptr);
}
void hot1PushCallback(void *ptr)
{
-
dbSerial.println("hot1PushCallback");
-
dbSerial.print("ptr=");
-
dbSerial.println((uint32_t)ptr);
+
dbSerialPrintln("hot1PushCallback");
+
dbSerialPrint("ptr=");
+
dbSerialPrintln((uint32_t)ptr);
}
void hot0PopCallback(void *ptr)
{
-
dbSerial.println("hot0PopCallback");
-
dbSerial.print("ptr=");
-
dbSerial.println((uint32_t)ptr);
+
dbSerialPrintln("hot0PopCallback");
+
dbSerialPrint("ptr=");
+
dbSerialPrintln((uint32_t)ptr);
}
void hot1PopCallback(void *ptr)
{
-
dbSerial.println("hot1PopCallback");
-
dbSerial.print("ptr=");
-
dbSerial.println((uint32_t)ptr);
+
dbSerialPrintln("hot1PopCallback");
+
dbSerialPrint("ptr=");
+
dbSerialPrintln((uint32_t)ptr);
}
void setup(void)
{
-
dbSerial.begin(9600);
+
dbSerialBegin(9600);
nexInit();
hot0.attachPush(hot0PushCallback, &hot0);
hot0.attachPop(hot0PopCallback, &hot0);
hot1.attachPush(hot1PushCallback, &hot1);
hot1.attachPop(hot1PopCallback, &hot1);
-
dbSerial.println("setup done");
+
dbSerialPrintln("setup done");
}
void loop(void)
{
-
dbSerial.println("nexLoop");
+
dbSerialPrintln("nexLoop");
nexLoop(nexListenList);
}
diff --git a/doc/API-html/_comp_hotspot_8ino_source.html b/doc/API-html/_comp_hotspot_8ino_source.html index 43d34c2..0a71cb4 100644 --- a/doc/API-html/_comp_hotspot_8ino_source.html +++ b/doc/API-html/_comp_hotspot_8ino_source.html @@ -68,59 +68,59 @@
27 
28 void hot0PushCallback(void *ptr)
29 {
-
30  dbSerial.println("hot0PushCallback");
-
31  dbSerial.print("ptr=");
-
32  dbSerial.println((uint32_t)ptr);
+
30  dbSerialPrintln("hot0PushCallback");
+
31  dbSerialPrint("ptr=");
+
32  dbSerialPrintln((uint32_t)ptr);
33 }
34 
35 void hot1PushCallback(void *ptr)
36 {
-
37  dbSerial.println("hot1PushCallback");
-
38  dbSerial.print("ptr=");
-
39  dbSerial.println((uint32_t)ptr);
+
37  dbSerialPrintln("hot1PushCallback");
+
38  dbSerialPrint("ptr=");
+
39  dbSerialPrintln((uint32_t)ptr);
40 }
41 
42 void hot0PopCallback(void *ptr)
43 {
-
44  dbSerial.println("hot0PopCallback");
-
45  dbSerial.print("ptr=");
-
46  dbSerial.println((uint32_t)ptr);
+
44  dbSerialPrintln("hot0PopCallback");
+
45  dbSerialPrint("ptr=");
+
46  dbSerialPrintln((uint32_t)ptr);
47 }
48 
49 void hot1PopCallback(void *ptr)
50 {
-
51  dbSerial.println("hot1PopCallback");
-
52  dbSerial.print("ptr=");
-
53  dbSerial.println((uint32_t)ptr);
+
51  dbSerialPrintln("hot1PopCallback");
+
52  dbSerialPrint("ptr=");
+
53  dbSerialPrintln((uint32_t)ptr);
54 }
55 
56 void setup(void)
57 {
-
58  dbSerial.begin(9600);
+
58  dbSerialBegin(9600);
59  nexInit();
60  hot0.attachPush(hot0PushCallback, &hot0);
61  hot0.attachPop(hot0PopCallback, &hot0);
62  hot1.attachPush(hot1PushCallback, &hot1);
63  hot1.attachPop(hot1PopCallback, &hot1);
-
64  dbSerial.println("setup done");
+
64  dbSerialPrintln("setup done");
65 }
66 
67 void loop(void)
68 {
-
69  dbSerial.println("nexLoop");
+
69  dbSerialPrintln("nexLoop");
70  nexLoop(nexListenList);
71 }
-
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:423
-
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
+
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:409
+
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:425
NexHotspot.h
API of NexHotspot.
NexHotspot
NexHotspot,subclass of NexTouch,provides simple methods to control hotspot component.
Definition: NexHotspot.h:25
NexHotspot::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register hotspot pop callback function.
Definition: NexHotspot.cpp:55
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
NexHotspot::attachPush
void attachPush(NexTouchEventCb push, void *ptr=NULL)
Register hotspot push callback function.
Definition: NexHotspot.cpp:35
diff --git a/doc/API-html/_comp_page_8ino-example.html b/doc/API-html/_comp_page_8ino-example.html index 998b645..c4c6792 100644 --- a/doc/API-html/_comp_page_8ino-example.html +++ b/doc/API-html/_comp_page_8ino-example.html @@ -67,51 +67,51 @@ This program is free software; you can redistribute it and/or modify it under th
void page0PopCallback(void *ptr)
{
-
dbSerial.println("page0PopCallback");
+
dbSerialPrintln("page0PopCallback");
page1.show();
}
void page1PopCallback(void *ptr)
{
-
dbSerial.println("page1PopCallback");
+
dbSerialPrintln("page1PopCallback");
page2.show();
}
void page2PopCallback(void *ptr)
{
-
dbSerial.println("page2PopCallback");
+
dbSerialPrintln("page2PopCallback");
page3.show();
}
void page3PopCallback(void *ptr)
{
-
dbSerial.println("page3PopCallback");
+
dbSerialPrintln("page3PopCallback");
page0.show();
}
void setup(void)
{
-
dbSerial.begin(9600);
+
dbSerialBegin(9600);
nexInit();
-
dbSerial.println("setup begin");
+
dbSerialPrintln("setup begin");
page0.attachPop(page0PopCallback);
page1.attachPop(page1PopCallback);
page2.attachPop(page2PopCallback);
page3.attachPop(page3PopCallback);
-
dbSerial.println("setup end");
+
dbSerialPrintln("setup end");
}
void loop(void)
{
-
dbSerial.println("nexLoop");
+
dbSerialPrintln("nexLoop");
nexLoop(nexListenList);
}
diff --git a/doc/API-html/_comp_page_8ino_source.html b/doc/API-html/_comp_page_8ino_source.html index 3982946..61642f5 100644 --- a/doc/API-html/_comp_page_8ino_source.html +++ b/doc/API-html/_comp_page_8ino_source.html @@ -72,58 +72,58 @@
31 
32 void page0PopCallback(void *ptr)
33 {
-
34  dbSerial.println("page0PopCallback");
+
34  dbSerialPrintln("page0PopCallback");
35  page1.show();
36 }
37 
38 void page1PopCallback(void *ptr)
39 {
-
40  dbSerial.println("page1PopCallback");
+
40  dbSerialPrintln("page1PopCallback");
41  page2.show();
42 }
43 
44 void page2PopCallback(void *ptr)
45 {
-
46  dbSerial.println("page2PopCallback");
+
46  dbSerialPrintln("page2PopCallback");
47  page3.show();
48 }
49 
50 void page3PopCallback(void *ptr)
51 {
-
52  dbSerial.println("page3PopCallback");
+
52  dbSerialPrintln("page3PopCallback");
53  page0.show();
54 }
55 
56 void setup(void)
57 {
-
58  dbSerial.begin(9600);
+
58  dbSerialBegin(9600);
59  nexInit();
-
60  dbSerial.println("setup begin");
+
60  dbSerialPrintln("setup begin");
61 
62  page0.attachPop(page0PopCallback);
63  page1.attachPop(page1PopCallback);
64  page2.attachPop(page2PopCallback);
65  page3.attachPop(page3PopCallback);
66 
-
67  dbSerial.println("setup end");
+
67  dbSerialPrintln("setup end");
68 }
69 
70 void loop(void)
71 {
-
72  dbSerial.println("nexLoop");
+
72  dbSerialPrintln("nexLoop");
73  nexLoop(nexListenList);
74 }
NexPage::show
bool show(void)
Change page.
Definition: NexPage.cpp:33
-
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:423
-
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
+
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:409
+
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:425
NexPage.h
API of NexPage.
NexPage
NexPage,subclass of NexTouch,provides simple methods to control page component.
Definition: NexPage.h:25
NexPage::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register page pop callback function.
Definition: NexPage.cpp:55
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_comp_picture_8ino-example.html b/doc/API-html/_comp_picture_8ino-example.html index 5c6dcaa..942f665 100644 --- a/doc/API-html/_comp_picture_8ino-example.html +++ b/doc/API-html/_comp_picture_8ino-example.html @@ -62,7 +62,7 @@ This program is free software; you can redistribute it and/or modify it under th
void p0PopCallback(void *ptr)
{
uint32_t number = 0;
-
dbSerial.println("p0PopCallback");
+
dbSerialPrintln("p0PopCallback");
p0.getPic(&number);
@@ -81,22 +81,22 @@ This program is free software; you can redistribute it and/or modify it under th
void setup(void)
{
-
dbSerial.begin(9600);
+
dbSerialBegin(9600);
nexInit();
p0.attachPop(p0PopCallback);
-
dbSerial.println("setup done");
+
dbSerialPrintln("setup done");
}
void loop(void)
{
-
dbSerial.println("nexLoop");
+
dbSerialPrintln("nexLoop");
nexLoop(nexListenList);
}
diff --git a/doc/API-html/_comp_picture_8ino_source.html b/doc/API-html/_comp_picture_8ino_source.html index a6762a1..07480f0 100644 --- a/doc/API-html/_comp_picture_8ino_source.html +++ b/doc/API-html/_comp_picture_8ino_source.html @@ -67,7 +67,7 @@
26 void p0PopCallback(void *ptr)
27 {
28  uint32_t number = 0;
-
29  dbSerial.println("p0PopCallback");
+
29  dbSerialPrintln("p0PopCallback");
30 
31  p0.getPic(&number);
32 
@@ -86,30 +86,30 @@
45 
46 void setup(void)
47 {
-
48  dbSerial.begin(9600);
+
48  dbSerialBegin(9600);
49  nexInit();
50  p0.attachPop(p0PopCallback);
-
51  dbSerial.println("setup done");
+
51  dbSerialPrintln("setup done");
52 }
53 
54 void loop(void)
55 {
-
56  dbSerial.println("nexLoop");
+
56  dbSerialPrintln("nexLoop");
57  nexLoop(nexListenList);
58 }
59 
-
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:423
+
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:409
NexPicture::setPic
bool setPic(uint32_t number)
Set picture's number.
Definition: NexPicture.cpp:52
-
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
+
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:425
NexPicture
NexPicture,subclass of NexTouch,provides simple methods to control picture component.
Definition: NexPicture.h:25
NexPicture::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register picture pop callback function.
Definition: NexPicture.cpp:72
NexPicture::getPic
bool getPic(uint32_t *number)
Get picture's number.
Definition: NexPicture.cpp:35
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
NexPicture.h
API of NexPicture.
diff --git a/doc/API-html/_comp_pointer_8ino-example.html b/doc/API-html/_comp_pointer_8ino-example.html index 34f57d6..1503f5d 100644 --- a/doc/API-html/_comp_pointer_8ino-example.html +++ b/doc/API-html/_comp_pointer_8ino-example.html @@ -66,7 +66,7 @@ This program is free software; you can redistribute it and/or modify it under th
void buttonUpPopCallback(void *ptr)
{
uint32_t number = 0;
-
dbSerial.println("buttonUpPopCallback");
+
dbSerialPrintln("buttonUpPopCallback");
pointer.getValue(&number);
@@ -81,7 +81,7 @@ This program is free software; you can redistribute it and/or modify it under th
void buttonDownPopCallback(void *ptr)
{
uint32_t number = 0;
-
dbSerial.println("buttonDownPopCallback");
+
dbSerialPrintln("buttonDownPopCallback");
pointer.getValue(&number);
@@ -97,23 +97,23 @@ This program is free software; you can redistribute it and/or modify it under th
void setup(void)
{
-
dbSerial.begin(9600);
+
dbSerialBegin(9600);
nexInit();
btn_up.attachPop(buttonUpPopCallback);
btn_down.attachPop(buttonDownPopCallback);
-
dbSerial.println("setup done");
+
dbSerialPrintln("setup done");
}
void loop(void)
{
-
dbSerial.println("nexLoop");
+
dbSerialPrintln("nexLoop");
nexLoop(nexListenList);
}
diff --git a/doc/API-html/_comp_pointer_8ino_source.html b/doc/API-html/_comp_pointer_8ino_source.html index edaf980..68b0254 100644 --- a/doc/API-html/_comp_pointer_8ino_source.html +++ b/doc/API-html/_comp_pointer_8ino_source.html @@ -71,7 +71,7 @@
30 void buttonUpPopCallback(void *ptr)
31 {
32  uint32_t number = 0;
-
33  dbSerial.println("buttonUpPopCallback");
+
33  dbSerialPrintln("buttonUpPopCallback");
34 
35  pointer.getValue(&number);
36 
@@ -86,7 +86,7 @@
45 void buttonDownPopCallback(void *ptr)
46 {
47  uint32_t number = 0;
-
48  dbSerial.println("buttonDownPopCallback");
+
48  dbSerialPrintln("buttonDownPopCallback");
49 
50  pointer.getValue(&number);
51 
@@ -102,32 +102,32 @@
61 
62 void setup(void)
63 {
-
64  dbSerial.begin(9600);
+
64  dbSerialBegin(9600);
65  nexInit();
66  btn_up.attachPop(buttonUpPopCallback);
67  btn_down.attachPop(buttonDownPopCallback);
-
68  dbSerial.println("setup done");
+
68  dbSerialPrintln("setup done");
69 }
70 
71 void loop(void)
72 {
-
73  dbSerial.println("nexLoop");
+
73  dbSerialPrintln("nexLoop");
74  nexLoop(nexListenList);
75 }
76 
-
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:423
+
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:409
NexButton.h
API of NexButton.
-
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
+
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:425
NexButton::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register button pop callback function.
Definition: NexButton.cpp:70
NexPointer::getValue
bool getValue(uint32_t *number)
Get the value of pointer.
Definition: NexPointer.cpp:20
NexPointer
NexPointer,subclass of NexTouch,provides simple methods to control pointer component.
Definition: NexPointer.h:10
NexButton
NexButton,subclass of NexTouch,provides simple methods to control button component.
Definition: NexButton.h:25
NexPointer::setValue
bool setValue(uint32_t number)
Set the value of pointer.
Definition: NexPointer.cpp:37
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_comp_progress_bar_8ino-example.html b/doc/API-html/_comp_progress_bar_8ino-example.html index 054cc47..c9080c1 100644 --- a/doc/API-html/_comp_progress_bar_8ino-example.html +++ b/doc/API-html/_comp_progress_bar_8ino-example.html @@ -66,7 +66,7 @@ This program is free software; you can redistribute it and/or modify it under th
void buttonUpPopCallback(void *ptr)
{
uint32_t number = 0;
-
dbSerial.println("buttonUpPopCallback");
+
dbSerialPrintln("buttonUpPopCallback");
j0.getValue(&number);
@@ -81,7 +81,7 @@ This program is free software; you can redistribute it and/or modify it under th
void buttonDownPopCallback(void *ptr)
{
uint32_t number = 0;
-
dbSerial.println("buttonDownPopCallback");
+
dbSerialPrintln("buttonDownPopCallback");
j0.getValue(&number);
@@ -99,23 +99,23 @@ This program is free software; you can redistribute it and/or modify it under th
{
uint32_t brightness = 0;
-
dbSerial.begin(9600);
+
dbSerialBegin(9600);
nexInit();
btn_up.attachPop(buttonUpPopCallback);
btn_down.attachPop(buttonDownPopCallback);
-
dbSerial.println("setup done");
+
dbSerialPrintln("setup done");
}
void loop(void)
{
-
dbSerial.println("nexLoop");
+
dbSerialPrintln("nexLoop");
nexLoop(nexListenList);
}
diff --git a/doc/API-html/_comp_progress_bar_8ino_source.html b/doc/API-html/_comp_progress_bar_8ino_source.html index 9bcd845..1fa46c7 100644 --- a/doc/API-html/_comp_progress_bar_8ino_source.html +++ b/doc/API-html/_comp_progress_bar_8ino_source.html @@ -71,7 +71,7 @@
30 void buttonUpPopCallback(void *ptr)
31 {
32  uint32_t number = 0;
-
33  dbSerial.println("buttonUpPopCallback");
+
33  dbSerialPrintln("buttonUpPopCallback");
34 
35  j0.getValue(&number);
36 
@@ -86,7 +86,7 @@
45 void buttonDownPopCallback(void *ptr)
46 {
47  uint32_t number = 0;
-
48  dbSerial.println("buttonDownPopCallback");
+
48  dbSerialPrintln("buttonDownPopCallback");
49 
50  j0.getValue(&number);
51 
@@ -104,33 +104,33 @@
63 {
64  uint32_t brightness = 0;
65 
-
66  dbSerial.begin(9600);
+
66  dbSerialBegin(9600);
67  nexInit();
68  btn_up.attachPop(buttonUpPopCallback);
69  btn_down.attachPop(buttonDownPopCallback);
-
70  dbSerial.println("setup done");
+
70  dbSerialPrintln("setup done");
71 }
72 
73 void loop(void)
74 {
-
75  dbSerial.println("nexLoop");
+
75  dbSerialPrintln("nexLoop");
76  nexLoop(nexListenList);
77 }
78 
NexProgressBar::setValue
bool setValue(uint32_t number)
Set the value of progress bar.
Definition: NexProgressBar.cpp:52
-
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:423
+
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:409
NexButton.h
API of NexButton.
-
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
+
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:425
NexButton::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register button pop callback function.
Definition: NexButton.cpp:70
NexButton
NexButton,subclass of NexTouch,provides simple methods to control button component.
Definition: NexButton.h:25
NexProgressBar::getValue
bool getValue(uint32_t *number)
Get the value of progress bar.
Definition: NexProgressBar.cpp:35
NexProgressBar.h
API of NexProgressBar.
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
NexProgressBar
NexProgressBar,subclass of NexTouch,provides simple methods to control progress bar component...
Definition: NexProgressBar.h:25
diff --git a/doc/API-html/_comp_slice_8ino-example.html b/doc/API-html/_comp_slice_8ino-example.html index 417f145..4eeaa03 100644 --- a/doc/API-html/_comp_slice_8ino-example.html +++ b/doc/API-html/_comp_slice_8ino-example.html @@ -62,7 +62,7 @@ This program is free software; you can redistribute it and/or modify it under th
void q0PopCallback(void *ptr)
{
uint32_t number = 0;
-
dbSerial.println("q0PopCallback");
+
dbSerialPrintln("q0PopCallback");
q0.getPic(&number);
@@ -75,22 +75,22 @@ This program is free software; you can redistribute it and/or modify it under th
void setup(void)
{
-
dbSerial.begin(9600);
+
dbSerialBegin(9600);
nexInit();
q0.attachPop(q0PopCallback);
-
dbSerial.println("setup done");
+
dbSerialPrintln("setup done");
}
void loop(void)
{
-
dbSerial.println("nexLoop");
+
dbSerialPrintln("nexLoop");
nexLoop(nexListenList);
}
diff --git a/doc/API-html/_comp_slice_8ino_source.html b/doc/API-html/_comp_slice_8ino_source.html index 550b53a..8afee7a 100644 --- a/doc/API-html/_comp_slice_8ino_source.html +++ b/doc/API-html/_comp_slice_8ino_source.html @@ -67,7 +67,7 @@
26 void q0PopCallback(void *ptr)
27 {
28  uint32_t number = 0;
-
29  dbSerial.println("q0PopCallback");
+
29  dbSerialPrintln("q0PopCallback");
30 
31  q0.getPic(&number);
32 
@@ -80,28 +80,28 @@
39 
40 void setup(void)
41 {
-
42  dbSerial.begin(9600);
+
42  dbSerialBegin(9600);
43  nexInit();
44  q0.attachPop(q0PopCallback);
-
45  dbSerial.println("setup done");
+
45  dbSerialPrintln("setup done");
46 }
47 
48 void loop(void)
49 {
-
50  dbSerial.println("nexLoop");
+
50  dbSerialPrintln("nexLoop");
51  nexLoop(nexListenList);
52 }
53 
NexSlice
NexSlice,subclass of NexTouch,provides simple methods to control slice component. ...
Definition: NexSlice.h:25
-
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:423
-
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
+
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:409
+
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:425
NexSlice::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register slice pop callback function.
Definition: NexSlice.cpp:72
NexSlice.h
API of NexSlice.
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_comp_text_8ino-example.html b/doc/API-html/_comp_text_8ino-example.html index b7d1c39..974c223 100644 --- a/doc/API-html/_comp_text_8ino-example.html +++ b/doc/API-html/_comp_text_8ino-example.html @@ -72,7 +72,7 @@ This program is free software; you can redistribute it and/or modify it under th
void t0PopCallback(void *ptr)
{
-
dbSerial.println("t0PopCallback");
+
dbSerialPrintln("t0PopCallback");
t0.setText("50");
}
@@ -81,7 +81,7 @@ This program is free software; you can redistribute it and/or modify it under th
uint16_t len;
uint16_t number;
-
dbSerial.println("b0PopCallback");
+
dbSerialPrintln("b0PopCallback");
memset(buffer, 0, sizeof(buffer));
t0.getText(buffer, sizeof(buffer));
@@ -100,7 +100,7 @@ This program is free software; you can redistribute it and/or modify it under th
uint16_t len;
uint16_t number;
-
dbSerial.println("b1PopCallback");
+
dbSerialPrintln("b1PopCallback");
memset(buffer, 0, sizeof(buffer));
t0.getText(buffer, sizeof(buffer));
@@ -116,21 +116,21 @@ This program is free software; you can redistribute it and/or modify it under th
void setup(void)
{
-
dbSerial.begin(9600);
+
dbSerialBegin(9600);
nexInit();
-
dbSerial.println("setup done");
+
dbSerialPrintln("setup done");
}
void loop(void)
{
-
dbSerial.println("nexLoop");
+
dbSerialPrintln("nexLoop");
nexLoop(nexListenList);
}
diff --git a/doc/API-html/_comp_text_8ino_source.html b/doc/API-html/_comp_text_8ino_source.html index 5e04be1..bf53676 100644 --- a/doc/API-html/_comp_text_8ino_source.html +++ b/doc/API-html/_comp_text_8ino_source.html @@ -77,7 +77,7 @@
36 
37 void t0PopCallback(void *ptr)
38 {
-
39  dbSerial.println("t0PopCallback");
+
39  dbSerialPrintln("t0PopCallback");
40  t0.setText("50");
41 }
42 
@@ -86,7 +86,7 @@
45  uint16_t len;
46  uint16_t number;
47 
-
48  dbSerial.println("b0PopCallback");
+
48  dbSerialPrintln("b0PopCallback");
49 
50  memset(buffer, 0, sizeof(buffer));
51  t0.getText(buffer, sizeof(buffer));
@@ -105,7 +105,7 @@
64  uint16_t len;
65  uint16_t number;
66 
-
67  dbSerial.println("b1PopCallback");
+
67  dbSerialPrintln("b1PopCallback");
68 
69  memset(buffer, 0, sizeof(buffer));
70  t0.getText(buffer, sizeof(buffer));
@@ -121,30 +121,30 @@
80 
81 void setup(void)
82 {
-
83  dbSerial.begin(9600);
+
83  dbSerialBegin(9600);
84  nexInit();
-
85  dbSerial.println("setup done");
+
85  dbSerialPrintln("setup done");
86 }
87 
88 void loop(void)
89 {
-
90  dbSerial.println("nexLoop");
+
90  dbSerialPrintln("nexLoop");
91  nexLoop(nexListenList);
92 }
93 
NexText::setText
bool setText(const char *buffer)
Set the value of text.
Definition: NexText.cpp:53
-
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:423
+
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:409
NexText.h
API of NexText.
NexButton.h
API of NexButton.
-
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
+
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:425
NexButton
NexButton,subclass of NexTouch,provides simple methods to control button component.
Definition: NexButton.h:25
NexText::getText
uint16_t getText(char *buffer, uint16_t len)
Get the value of text.
Definition: NexText.cpp:35
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
NexText
NexText,subclass of NexTouch,provides simple methods to control text component.
Definition: NexText.h:25
diff --git a/doc/API-html/_nex_button_8cpp.html b/doc/API-html/_nex_button_8cpp.html index 36aa867..f39e7f8 100644 --- a/doc/API-html/_nex_button_8cpp.html +++ b/doc/API-html/_nex_button_8cpp.html @@ -66,7 +66,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_button_8cpp_source.html b/doc/API-html/_nex_button_8cpp_source.html index 1421eda..aee0243 100644 --- a/doc/API-html/_nex_button_8cpp_source.html +++ b/doc/API-html/_nex_button_8cpp_source.html @@ -99,11 +99,11 @@
NexTouch::recvRetString
static uint16_t recvRetString(char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data.
Definition: NexTouch.cpp:284
NexButton::detachPop
void detachPop(void)
Unload button pop callback function.
Definition: NexButton.cpp:79
NexTouch::recvRetCommandFinished
static bool recvRetCommandFinished(uint32_t timeout=100)
Command is executed successfully.
Definition: NexTouch.cpp:224
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_nex_button_8h.html b/doc/API-html/_nex_button_8h.html index f1d968d..fb64255 100644 --- a/doc/API-html/_nex_button_8h.html +++ b/doc/API-html/_nex_button_8h.html @@ -75,7 +75,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_button_8h_source.html b/doc/API-html/_nex_button_8h_source.html index c746118..1915136 100644 --- a/doc/API-html/_nex_button_8h_source.html +++ b/doc/API-html/_nex_button_8h_source.html @@ -76,11 +76,11 @@
NexButton::setText
bool setText(const char *buffer)
Set text value of button component.
Definition: NexButton.cpp:53
NexTouch.h
API of Nextion.
NexButton::detachPop
void detachPop(void)
Unload button pop callback function.
Definition: NexButton.cpp:79
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_nex_hotspot_8cpp.html b/doc/API-html/_nex_hotspot_8cpp.html index a6a6fcc..d0b865c 100644 --- a/doc/API-html/_nex_hotspot_8cpp.html +++ b/doc/API-html/_nex_hotspot_8cpp.html @@ -66,7 +66,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_hotspot_8cpp_source.html b/doc/API-html/_nex_hotspot_8cpp_source.html index f70d152..d6a66ff 100644 --- a/doc/API-html/_nex_hotspot_8cpp_source.html +++ b/doc/API-html/_nex_hotspot_8cpp_source.html @@ -83,12 +83,12 @@
NexHotspot::NexHotspot
NexHotspot(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
Definition: NexHotspot.cpp:22
NexHotspot.h
API of NexHotspot.
NexHotspot::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register hotspot pop callback function.
Definition: NexHotspot.cpp:55
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
NexHotspot::attachPush
void attachPush(NexTouchEventCb push, void *ptr=NULL)
Register hotspot push callback function.
Definition: NexHotspot.cpp:35
diff --git a/doc/API-html/_nex_hotspot_8h.html b/doc/API-html/_nex_hotspot_8h.html index 840b867..9d0dd7b 100644 --- a/doc/API-html/_nex_hotspot_8h.html +++ b/doc/API-html/_nex_hotspot_8h.html @@ -75,7 +75,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_hotspot_8h_source.html b/doc/API-html/_nex_hotspot_8h_source.html index 0d46de5..c24f5fd 100644 --- a/doc/API-html/_nex_hotspot_8h_source.html +++ b/doc/API-html/_nex_hotspot_8h_source.html @@ -77,12 +77,12 @@
NexHotspot::NexHotspot
NexHotspot(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
Definition: NexHotspot.cpp:22
NexHotspot
NexHotspot,subclass of NexTouch,provides simple methods to control hotspot component.
Definition: NexHotspot.h:25
NexHotspot::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register hotspot pop callback function.
Definition: NexHotspot.cpp:55
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
NexHotspot::attachPush
void attachPush(NexTouchEventCb push, void *ptr=NULL)
Register hotspot push callback function.
Definition: NexHotspot.cpp:35
diff --git a/doc/API-html/_nex_page_8cpp.html b/doc/API-html/_nex_page_8cpp.html index ba8b513..220479f 100644 --- a/doc/API-html/_nex_page_8cpp.html +++ b/doc/API-html/_nex_page_8cpp.html @@ -66,7 +66,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_page_8cpp_source.html b/doc/API-html/_nex_page_8cpp_source.html index c35bda6..a77dc3b 100644 --- a/doc/API-html/_nex_page_8cpp_source.html +++ b/doc/API-html/_nex_page_8cpp_source.html @@ -90,11 +90,11 @@
NexPage::NexPage
NexPage(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
Definition: NexPage.cpp:22
NexPage::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register page pop callback function.
Definition: NexPage.cpp:55
NexTouch::recvRetCommandFinished
static bool recvRetCommandFinished(uint32_t timeout=100)
Command is executed successfully.
Definition: NexTouch.cpp:224
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_nex_page_8h.html b/doc/API-html/_nex_page_8h.html index 9210a5f..fed821f 100644 --- a/doc/API-html/_nex_page_8h.html +++ b/doc/API-html/_nex_page_8h.html @@ -75,7 +75,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_page_8h_source.html b/doc/API-html/_nex_page_8h_source.html index 47053ca..7ccb850 100644 --- a/doc/API-html/_nex_page_8h_source.html +++ b/doc/API-html/_nex_page_8h_source.html @@ -74,11 +74,11 @@
NexTouch.h
API of Nextion.
NexPage::NexPage
NexPage(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
Definition: NexPage.cpp:22
NexPage::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register page pop callback function.
Definition: NexPage.cpp:55
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_nex_picture_8cpp.html b/doc/API-html/_nex_picture_8cpp.html index e475cb6..9caf15b 100644 --- a/doc/API-html/_nex_picture_8cpp.html +++ b/doc/API-html/_nex_picture_8cpp.html @@ -66,7 +66,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_picture_8cpp_source.html b/doc/API-html/_nex_picture_8cpp_source.html index 17387f2..bc11702 100644 --- a/doc/API-html/_nex_picture_8cpp_source.html +++ b/doc/API-html/_nex_picture_8cpp_source.html @@ -99,12 +99,12 @@
NexTouch::recvRetNumber
static bool recvRetNumber(uint32_t *number, uint32_t timeout=500)
Receive uint32_t data.
Definition: NexTouch.cpp:356
NexTouch::recvRetCommandFinished
static bool recvRetCommandFinished(uint32_t timeout=100)
Command is executed successfully.
Definition: NexTouch.cpp:224
NexPicture::getPic
bool getPic(uint32_t *number)
Get picture's number.
Definition: NexPicture.cpp:35
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
NexPicture.h
API of NexPicture.
diff --git a/doc/API-html/_nex_picture_8h.html b/doc/API-html/_nex_picture_8h.html index 57c5802..4b639bf 100644 --- a/doc/API-html/_nex_picture_8h.html +++ b/doc/API-html/_nex_picture_8h.html @@ -75,7 +75,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_picture_8h_source.html b/doc/API-html/_nex_picture_8h_source.html index 9ece8de..6a6c374 100644 --- a/doc/API-html/_nex_picture_8h_source.html +++ b/doc/API-html/_nex_picture_8h_source.html @@ -76,11 +76,11 @@
NexTouch.h
API of Nextion.
NexPicture::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register picture pop callback function.
Definition: NexPicture.cpp:72
NexPicture::getPic
bool getPic(uint32_t *number)
Get picture's number.
Definition: NexPicture.cpp:35
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_nex_pointer_8cpp_source.html b/doc/API-html/_nex_pointer_8cpp_source.html index 32322b1..05cda0a 100644 --- a/doc/API-html/_nex_pointer_8cpp_source.html +++ b/doc/API-html/_nex_pointer_8cpp_source.html @@ -86,11 +86,11 @@
NexPointer::NexPointer
NexPointer(NexPid pid, NexCid cid, char *name)
Constructor,inherited NexTouch's constructor function.
Definition: NexPointer.cpp:7
NexPointer::setValue
bool setValue(uint32_t number)
Set the value of pointer.
Definition: NexPointer.cpp:37
NexTouch::recvRetCommandFinished
static bool recvRetCommandFinished(uint32_t timeout=100)
Command is executed successfully.
Definition: NexTouch.cpp:224
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_nex_pointer_8h_source.html b/doc/API-html/_nex_pointer_8h_source.html index 6eb2af5..c59be0c 100644 --- a/doc/API-html/_nex_pointer_8h_source.html +++ b/doc/API-html/_nex_pointer_8h_source.html @@ -70,11 +70,11 @@
NexTouch.h
API of Nextion.
NexPointer::NexPointer
NexPointer(NexPid pid, NexCid cid, char *name)
Constructor,inherited NexTouch's constructor function.
Definition: NexPointer.cpp:7
NexPointer::setValue
bool setValue(uint32_t number)
Set the value of pointer.
Definition: NexPointer.cpp:37
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_nex_progress_bar_8cpp.html b/doc/API-html/_nex_progress_bar_8cpp.html index a6d7309..73fe426 100644 --- a/doc/API-html/_nex_progress_bar_8cpp.html +++ b/doc/API-html/_nex_progress_bar_8cpp.html @@ -66,7 +66,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_progress_bar_8cpp_source.html b/doc/API-html/_nex_progress_bar_8cpp_source.html index be20d7f..1ee65e3 100644 --- a/doc/API-html/_nex_progress_bar_8cpp_source.html +++ b/doc/API-html/_nex_progress_bar_8cpp_source.html @@ -88,11 +88,11 @@
NexProgressBar::NexProgressBar
NexProgressBar(NexPid pid, NexCid cid, char *name)
Constructor,inherited NexTouch's constructor function.
Definition: NexProgressBar.cpp:22
NexTouch::recvRetCommandFinished
static bool recvRetCommandFinished(uint32_t timeout=100)
Command is executed successfully.
Definition: NexTouch.cpp:224
NexProgressBar.h
API of NexProgressBar.
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_nex_progress_bar_8h.html b/doc/API-html/_nex_progress_bar_8h.html index 684572e..4def6b0 100644 --- a/doc/API-html/_nex_progress_bar_8h.html +++ b/doc/API-html/_nex_progress_bar_8h.html @@ -75,7 +75,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_progress_bar_8h_source.html b/doc/API-html/_nex_progress_bar_8h_source.html index 1a0fcab..2c1ffc4 100644 --- a/doc/API-html/_nex_progress_bar_8h_source.html +++ b/doc/API-html/_nex_progress_bar_8h_source.html @@ -70,12 +70,12 @@
NexTouch.h
API of Nextion.
NexProgressBar::getValue
bool getValue(uint32_t *number)
Get the value of progress bar.
Definition: NexProgressBar.cpp:35
NexProgressBar::NexProgressBar
NexProgressBar(NexPid pid, NexCid cid, char *name)
Constructor,inherited NexTouch's constructor function.
Definition: NexProgressBar.cpp:22
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
NexProgressBar
NexProgressBar,subclass of NexTouch,provides simple methods to control progress bar component...
Definition: NexProgressBar.h:25
diff --git a/doc/API-html/_nex_serial_config_8h.html b/doc/API-html/_nex_serial_config_8h.html new file mode 100644 index 00000000..5328c39 --- /dev/null +++ b/doc/API-html/_nex_serial_config_8h.html @@ -0,0 +1,73 @@ + + + + + + +API: NexSerialConfig.h File Reference + + + + + + +
+
+ + + + + + + +
+
API +
+
For Arduino developers
+
+
+ + + + +
+
+
+
NexSerialConfig.h File Reference
+
+
+ +

Serial configure. +More...

+ +

Go to the source code of this file.

+

Detailed Description

+

Serial configure.

+
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
+
Date
2015/7/10
+ + +

Definition in file NexSerialConfig.h.

+
+ + + + diff --git a/doc/API-html/_nex_serial_config_8h_source.html b/doc/API-html/_nex_serial_config_8h_source.html new file mode 100644 index 00000000..d102954 --- /dev/null +++ b/doc/API-html/_nex_serial_config_8h_source.html @@ -0,0 +1,84 @@ + + + + + + +API: NexSerialConfig.h Source File + + + + + + +
+
+ + + + + + + +
+
API +
+
For Arduino developers
+
+
+ + + + +
+
+
+
NexSerialConfig.h
+
+
+Go to the documentation of this file.
1 
+
16 #ifndef __NexSerialConfig_H__
+
17 #define __NexSerialConfig_H__
+
18 
+
19 /*enable debug serial*/
+
20 #define DEBUG_SERIAL_ENABLE
+
21 
+
22 /*define serial for debug*/
+
23 #define dbSerial Serial
+
24 
+
25 #ifdef DEBUG_SERIAL_ENABLE
+
26 #define dbSerialPrint(a) dbSerial.print(a)
+
27 #define dbSerialPrintln(a) dbSerial.println(a)
+
28 #define dbSerialBegin(a) dbSerial.begin(a)
+
29 #else
+
30 #define dbSerialPrint(a)
+
31 #define dbSerialPrintln(a)
+
32 #define dbSerialBegin(a)
+
33 #endif
+
34 
+
35 /*define serial for communicate with Nextion screen*/
+
36 #define nexSerial Serial2
+
37 
+
38 #endif
+
+ + + + diff --git a/doc/API-html/_nex_slice_8cpp.html b/doc/API-html/_nex_slice_8cpp.html index 3aa24ea..a56c993 100644 --- a/doc/API-html/_nex_slice_8cpp.html +++ b/doc/API-html/_nex_slice_8cpp.html @@ -66,7 +66,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_slice_8cpp_source.html b/doc/API-html/_nex_slice_8cpp_source.html index c75d6df..0d6e66e 100644 --- a/doc/API-html/_nex_slice_8cpp_source.html +++ b/doc/API-html/_nex_slice_8cpp_source.html @@ -114,11 +114,11 @@
NexSlice::NexSlice
NexSlice(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
Definition: NexSlice.cpp:22
NexTouch::recvRetNumber
static bool recvRetNumber(uint32_t *number, uint32_t timeout=500)
Receive uint32_t data.
Definition: NexTouch.cpp:356
NexTouch::recvRetCommandFinished
static bool recvRetCommandFinished(uint32_t timeout=100)
Command is executed successfully.
Definition: NexTouch.cpp:224
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_nex_slice_8h.html b/doc/API-html/_nex_slice_8h.html index b22b582..594eee5 100644 --- a/doc/API-html/_nex_slice_8h.html +++ b/doc/API-html/_nex_slice_8h.html @@ -75,7 +75,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_slice_8h_source.html b/doc/API-html/_nex_slice_8h_source.html index f8e2cc5..50611b4 100644 --- a/doc/API-html/_nex_slice_8h_source.html +++ b/doc/API-html/_nex_slice_8h_source.html @@ -74,11 +74,11 @@
NexTouch.h
API of Nextion.
NexSlice::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register slice pop callback function.
Definition: NexSlice.cpp:72
NexSlice::NexSlice
NexSlice(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
Definition: NexSlice.cpp:22
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_nex_text_8cpp.html b/doc/API-html/_nex_text_8cpp.html index a3a519e..0fc1c77 100644 --- a/doc/API-html/_nex_text_8cpp.html +++ b/doc/API-html/_nex_text_8cpp.html @@ -66,7 +66,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_text_8cpp_source.html b/doc/API-html/_nex_text_8cpp_source.html index c070ab9..025e0fa 100644 --- a/doc/API-html/_nex_text_8cpp_source.html +++ b/doc/API-html/_nex_text_8cpp_source.html @@ -98,11 +98,11 @@
NexTouch::recvRetString
static uint16_t recvRetString(char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data.
Definition: NexTouch.cpp:284
NexText::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register text pop callback function.
Definition: NexText.cpp:70
NexTouch::recvRetCommandFinished
static bool recvRetCommandFinished(uint32_t timeout=100)
Command is executed successfully.
Definition: NexTouch.cpp:224
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/_nex_text_8h.html b/doc/API-html/_nex_text_8h.html index e9f6050..bbf65cb 100644 --- a/doc/API-html/_nex_text_8h.html +++ b/doc/API-html/_nex_text_8h.html @@ -75,7 +75,7 @@ This program is free software; you can redistribute it and/or modify it under th diff --git a/doc/API-html/_nex_text_8h_source.html b/doc/API-html/_nex_text_8h_source.html index 7cf9237..1ba1ac4 100644 --- a/doc/API-html/_nex_text_8h_source.html +++ b/doc/API-html/_nex_text_8h_source.html @@ -75,12 +75,12 @@
NexTouch.h
API of Nextion.
NexText::NexText
NexText(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
Definition: NexText.cpp:22
NexText::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register text pop callback function.
Definition: NexText.cpp:70
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
NexText
NexText,subclass of NexTouch,provides simple methods to control text component.
Definition: NexText.h:25
diff --git a/doc/API-html/_nex_touch_8cpp.html b/doc/API-html/_nex_touch_8cpp.html index 2ed6729..4f03156 100644 --- a/doc/API-html/_nex_touch_8cpp.html +++ b/doc/API-html/_nex_touch_8cpp.html @@ -66,6 +66,36 @@ Functions bool nexLoop (NexTouch **nexListenList)  Call mainEventLoop,watting for Nextion's touch event. More...
  +bool sendCurrentPageId (uint8_t *pageId) + Return current page id. More...
+  +bool touchCalibration (void) + Touch screen calibration. More...
+  +bool disableTouchFocus (void) + Disable all touch hot. More...
+  +bool pauseSerialCommand (void) + Pause serial instruction execution. More...
+  +bool recoverySerialCommand (void) + Recovery serial instruction execution. More...
+  +bool setCurrentBrightness (uint8_t dimValue) + Set current backlight brightness value. More...
+  +bool setDefaultBrightness (uint8_t dimDefaultValue) + Set default backlight brightness value. More...
+  +bool sleepMode (uint8_t mode) + Set device in sleep mode. More...
+  +bool setCurrentBaudrate (uint32_t baudrate) + Set current baudrate. More...
+  +bool setDefaultBaudrate (uint32_t defaultBaudrate) + Set default baudrate. More...

Detailed Description

API of Nextion.

@@ -76,6 +106,33 @@ This program is free software; you can redistribute it and/or modify it under th

Definition in file NexTouch.cpp.

Function Documentation

+ +
+
+ + + + + + + + +
bool disableTouchFocus (void )
+
+ +

Disable all touch hot.

+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 513 of file NexTouch.cpp.

+ +
+
@@ -100,7 +157,7 @@ This program is free software; you can redistribute it and/or modify it under th
Examples:
CompButton.ino, CompHotspot.ino, CompPage.ino, CompPicture.ino, CompPointer.ino, CompProgressBar.ino, CompSlice.ino, and CompText.ino.
-

Definition at line 423 of file NexTouch.cpp.

+

Definition at line 409 of file NexTouch.cpp.

@@ -133,14 +190,293 @@ This program is free software; you can redistribute it and/or modify it under th
Examples:
CompButton.ino, CompHotspot.ino, CompPage.ino, CompPicture.ino, CompPointer.ino, CompProgressBar.ino, CompSlice.ino, and CompText.ino.
-

Definition at line 440 of file NexTouch.cpp.

+

Definition at line 425 of file NexTouch.cpp.

+ + + + +
+
+ + + + + + + + +
bool pauseSerialCommand (void )
+
+ +

Pause serial instruction execution.

+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 537 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool recoverySerialCommand (void )
+
+ +

Recovery serial instruction execution.

+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 562 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool sendCurrentPageId (uint8_t * pageId)
+
+ +

Return current page id.

+
Parameters
+ + +
pageId- output parameter,to save page id.
+
+
+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 439 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool setCurrentBaudrate (uint32_t baudrate)
+
+ +

Set current baudrate.

+
Parameters
+ + +
baudrate- current baudrate,it surrpots 2400,4800,9600,19200,38400,57600,38400.
+
+
+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 694 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool setCurrentBrightness (uint8_t dimValue)
+
+ +

Set current backlight brightness value.

+
Parameters
+ + +
dimValue- current backlight brightness value.
+
+
+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 588 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool setDefaultBaudrate (uint32_t defaultBaudrate)
+
+ +

Set default baudrate.

+
Parameters
+ + +
defaultBaudrate- default baudrate,it surrpots 2400,4800,9600,19200,38400,57600,38400.
+
+
+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 726 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool setDefaultBrightness (uint8_t dimDefaultValue)
+
+ +

Set default backlight brightness value.

+
Parameters
+ + +
dimDefaultValue- default backlight brightness value.
+
+
+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 623 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool sleepMode (uint8_t mode)
+
+ +

Set device in sleep mode.

+
Parameters
+ + +
mode- 1:into sleep mode,0:exit sleep mode.
+
+
+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 657 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool touchCalibration (void )
+
+ +

Touch screen calibration.

+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 489 of file NexTouch.cpp.

diff --git a/doc/API-html/_nex_touch_8cpp_source.html b/doc/API-html/_nex_touch_8cpp_source.html index cec7317..d51c8fd 100644 --- a/doc/API-html/_nex_touch_8cpp_source.html +++ b/doc/API-html/_nex_touch_8cpp_source.html @@ -120,26 +120,26 @@
116 
122 void NexTouch::print(void)
123 {
-
124  dbSerial.print("[");
-
125  dbSerial.print((uint32_t)this);
-
126  dbSerial.print(":");
-
127  dbSerial.print(pid);
-
128  dbSerial.print(",");
-
129  dbSerial.print(cid);
-
130  dbSerial.print(",");
+
124  dbSerialPrint("[");
+
125  dbSerialPrint((uint32_t)this);
+
126  dbSerialPrint(":");
+
127  dbSerialPrint(pid);
+
128  dbSerialPrint(",");
+
129  dbSerialPrint(cid);
+
130  dbSerialPrint(",");
131  if (name)
132  {
-
133  dbSerial.print(name);
+
133  dbSerialPrint(name);
134  }
135  else
136  {
-
137  dbSerial.print("(null)");
+
137  dbSerialPrint("(null)");
138  }
-
139  dbSerial.print(",");
-
140  dbSerial.print((uint32_t)cbPush);
-
141  dbSerial.print(",");
-
142  dbSerial.print((uint32_t)cbPop);
-
143  dbSerial.println("]");
+
139  dbSerialPrint(",");
+
140  dbSerialPrint((uint32_t)cbPush);
+
141  dbSerialPrint(",");
+
142  dbSerialPrint((uint32_t)cbPop);
+
143  dbSerialPrintln("]");
144 }
145 
146 void NexTouch::attachPush(NexTouchEventCb push, void *ptr)
@@ -233,11 +233,11 @@
243 
244  if (ret)
245  {
-
246  dbSerial.println("recvRetCommandFinished ok");
+
246  dbSerialPrintln("recvRetCommandFinished ok");
247  }
248  else
249  {
-
250  dbSerial.println("recvRetCommandFinished err");
+
250  dbSerialPrintln("recvRetCommandFinished err");
251  }
252 
253  return ret;
@@ -309,11 +309,11 @@
334 
335 __return:
336 
-
337  dbSerial.print("recvRetString[");
-
338  dbSerial.print(temp.length());
-
339  dbSerial.print(",");
-
340  dbSerial.print(temp);
-
341  dbSerial.println("]");
+
337  dbSerialPrint("recvRetString[");
+
338  dbSerialPrint(temp.length());
+
339  dbSerialPrint(",");
+
340  dbSerialPrint(temp);
+
341  dbSerialPrintln("]");
342 
343  return ret;
344 }
@@ -348,72 +348,333 @@
383 
384  if (ret)
385  {
-
386  dbSerial.print("recvRetNumber :");
-
387  dbSerial.println(*number);
+
386  dbSerialPrint("recvRetNumber :");
+
387  dbSerialPrintln(*number);
388  }
389  else
390  {
-
391  dbSerial.println("recvRetNumber err");
+
391  dbSerialPrintln("recvRetNumber err");
392  }
393 
394  return ret;
395 }
396 
-
397 bool NexTouch::setBrightness(uint32_t brightness)
-
398 {
-
399  char buf[10] = {0};
-
400  String cmd;
-
401 
-
402  utoa(brightness, buf, 10);
-
403  cmd += "dim=";
-
404  cmd += buf;
-
405 
-
406  sendCommand(cmd.c_str());
-
407  return recvRetCommandFinished();
-
408 }
-
409 
-
410 bool NexTouch::getBrightness(uint32_t *brightness)
-
411 {
-
412  sendCommand("get dim");
-
413  return recvRetNumber(brightness);
-
414 }
-
415 
-
416 
-
423 bool nexInit(void)
-
424 {
-
425  nexSerial.begin(9600);
-
426  NexTouch::sendCommand("");
-
427  NexTouch::sendCommand("page 0");
-
428  delay(100);
-
429  return true;
-
430 }
-
431 
-
432 
-
440 bool nexLoop(NexTouch **nexListenList)
-
441 {
-
442  NexTouch::mainEventLoop(nexListenList);
-
443  return false;
-
444 }
-
445 
-
446 
+
397 bool NexTouch::getBrightness(uint32_t *brightness)
+
398 {
+
399  sendCommand("get dim");
+
400  return recvRetNumber(brightness);
+
401 }
+
402 
+
409 bool nexInit(void)
+
410 {
+
411  nexSerial.begin(9600);
+
412  NexTouch::sendCommand("");
+
413  NexTouch::sendCommand("page 0");
+
414  delay(100);
+
415  return true;
+
416 }
+
417 
+
425 bool nexLoop(NexTouch **nexListenList)
+
426 {
+
427  NexTouch::mainEventLoop(nexListenList);
+
428  return false;
+
429 }
+
430 
+
439 bool sendCurrentPageId(uint8_t* pageId)
+
440 {
+
441 
+
442  bool ret = false;
+
443  uint8_t temp[5] = {0};
+
444 
+
445  if (!pageId)
+
446  {
+
447  goto __return;
+
448  }
+
449  NexTouch::sendCommand("sendme");
+
450  delay(50);
+
451  nexSerial.setTimeout(500);
+
452  if (sizeof(temp) != nexSerial.readBytes((char *)temp, sizeof(temp)))
+
453  {
+
454  goto __return;
+
455  }
+
456 
+
457  if (temp[0] == NEX_RET_CURRENT_PAGE_ID_HEAD
+
458  && temp[2] == 0xFF
+
459  && temp[3] == 0xFF
+
460  && temp[4] == 0xFF
+
461  )
+
462  {
+
463  *pageId = temp[1];
+
464  ret = true;
+
465  }
+
466 
+
467  __return:
+
468 
+
469  if (ret)
+
470  {
+
471  dbSerialPrint("recvPageId :");
+
472  dbSerialPrintln(*pageId);
+
473  }
+
474  else
+
475  {
+
476  dbSerialPrintln("recvPageId err");
+
477  }
+
478 
+
479  return ret;
+
480 
+
481 }
+
482 
+
489 bool touchCalibration(void)
+
490 {
+
491  bool ret = false;
+
492  NexTouch::sendCommand("touch_j");
+
493  delay(10);
+
494  if(NexTouch::recvRetCommandFinished())
+
495  {
+
496  dbSerialPrintln("TouchCalibration ok ");
+
497  ret = true;
+
498  }
+
499  else
+
500  {
+
501  dbSerialPrintln("TouchCalibration err ");
+
502  }
+
503 
+
504  return ret;
+
505 }
+
506 
+
513 bool disableTouchFocus(void)
+
514 {
+
515  bool ret = false;
+
516  NexTouch::sendCommand("cle_c");
+
517  delay(10);
+
518  if(NexTouch::recvRetCommandFinished())
+
519  {
+
520  dbSerialPrintln("disableTouchFocus ok ");
+
521  ret = true;
+
522  }
+
523  else
+
524  {
+
525  dbSerialPrintln("disableTouchFocus err ");
+
526  }
+
527 
+
528  return ret;
+
529 }
+
530 
+
537 bool pauseSerialCommand(void)
+
538 {
+
539 
+
540  bool ret = false;
+
541  NexTouch::sendCommand("com_stop");
+
542  delay(10);
+
543  if(NexTouch::recvRetCommandFinished())
+
544  {
+
545  dbSerialPrintln("pauseSerialCommand ok ");
+
546  ret = true;
+
547  }
+
548  else
+
549  {
+
550  dbSerialPrintln("pauseSerialCommand err ");
+
551  }
+
552 
+
553  return ret;
+
554 }
+
555 
+
562 bool recoverySerialCommand(void)
+
563 {
+
564  bool ret = false;
+
565  NexTouch::sendCommand("com_star");
+
566  delay(10);
+
567  if(NexTouch::recvRetCommandFinished())
+
568  {
+
569  dbSerialPrintln("recoverySerialCommand ok ");
+
570  ret = true;
+
571  }
+
572  else
+
573  {
+
574  dbSerialPrintln("recoverySerialCommand err ");
+
575  }
+
576 
+
577  return ret;
+
578 }
+
579 
+
588 bool setCurrentBrightness(uint8_t dimValue)
+
589 {
+
590  bool ret = false;
+
591  char buf[10] = {0};
+
592  String cmd;
+
593  utoa(dimValue, buf, 10);
+
594  cmd += "dim=";
+
595  cmd += buf;
+
596  NexTouch::sendCommand(cmd.c_str());
+
597  delay(10);
+
598 
+
599  if(NexTouch::recvRetCommandFinished())
+
600  {
+
601  dbSerialPrint("setCurrentBrightness[ ");
+
602  dbSerialPrint(dimValue);
+
603  dbSerialPrintln("]ok ");
+
604 
+
605  ret = true;
+
606  }
+
607  else
+
608  {
+
609  dbSerialPrintln("setCurrentBrightness err ");
+
610  }
+
611 
+
612  return ret;
+
613 }
+
614 
+
623 bool setDefaultBrightness(uint8_t dimDefaultValue)
+
624 {
+
625  bool ret = false;
+
626  char buf[10] = {0};
+
627  String cmd;
+
628  utoa(dimDefaultValue, buf, 10);
+
629  cmd += "dims=";
+
630  cmd += buf;
+
631  NexTouch::sendCommand(cmd.c_str());
+
632  delay(10);
+
633 
+
634  if(NexTouch::recvRetCommandFinished())
+
635  {
+
636  dbSerialPrint("setDefaultBrightness[");
+
637  dbSerialPrint(dimDefaultValue);
+
638  dbSerialPrintln("]ok");
+
639  ret = true;
+
640  }
+
641  else
+
642  {
+
643  dbSerialPrintln("setDefaultBrightness err ");
+
644  }
+
645 
+
646  return ret;
+
647 }
+
648 
+
657 bool sleepMode(uint8_t mode)
+
658 {
+
659  bool ret = false;
+
660  char buf[10] = {0};
+
661  String cmd;
+
662  if(mode != 0 && mode != 1)
+
663  {
+
664  dbSerialPrintln("mode input ok ");
+
665  return ret;
+
666  }
+
667  utoa(mode, buf, 10);
+
668  cmd += "sleep=";
+
669  cmd += buf;
+
670  NexTouch::sendCommand(cmd.c_str());
+
671  delay(10);
+
672 
+
673  if(NexTouch::recvRetCommandFinished())
+
674  {
+
675  dbSerialPrintln("sleepMode ok ");
+
676  ret = true;
+
677  }
+
678  else
+
679  {
+
680  dbSerialPrintln("sleepMode err ");
+
681  }
+
682 
+
683  return ret;
+
684 }
+
685 
+
694 bool setCurrentBaudrate(uint32_t baudrate)
+
695 {
+
696  bool ret = false;
+
697  char buf[10] = {0};
+
698  String cmd;
+
699  utoa(baudrate, buf, 10);
+
700  cmd += "baud=";
+
701  cmd += buf;
+
702  NexTouch::sendCommand(cmd.c_str());
+
703  delay(10);
+
704 
+
705  if(NexTouch::recvRetCommandFinished())
+
706  {
+
707  dbSerialPrintln("setCurrentBaudrate ok ");
+
708  ret = true;
+
709  }
+
710  else
+
711  {
+
712  dbSerialPrintln("setCurrentBaudrate err ");
+
713  }
+
714 
+
715  return ret;
+
716 }
+
717 
+
726 bool setDefaultBaudrate(uint32_t defaultBaudrate)
+
727 {
+
728  bool ret = false;
+
729  char buf[10] = {0};
+
730  String cmd;
+
731  utoa(defaultBaudrate, buf, 10);
+
732  cmd += "bauds=";
+
733  cmd += buf;
+
734  NexTouch::sendCommand(cmd.c_str());
+
735  delay(10);
+
736 
+
737  if(NexTouch::recvRetCommandFinished())
+
738  {
+
739  dbSerialPrintln("setDefaultBaudrate ok ");
+
740  ret = true;
+
741  }
+
742  else
+
743  {
+
744  dbSerialPrintln("setDefaultBaudrate err ");
+
745  }
+
746 
+
747  return ret;
+
748 }
+
749 
+
750 
+
751 
+
752 
+
753 
+
754 
+
755 
+
756 
+
757 
+
758 
+
759 
+
760 
+
761 
+
762 
+
763 
+
764 
+
765 
+
766 
+
767 
+
768 
+
769 
NexTouch::getPid
NexPid getPid(void)
Get page id.
Definition: NexTouch.cpp:92
+
setDefaultBaudrate
bool setDefaultBaudrate(uint32_t defaultBaudrate)
Set default baudrate.
Definition: NexTouch.cpp:726
NexTouch::NexTouch
NexTouch(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL)
Constructor of Nextouch.
Definition: NexTouch.cpp:74
-
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:423
-
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
+
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:409
+
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:425
NexTouch::sendCommand
static void sendCommand(const char *cmd)
Send command to Nextion.
Definition: NexTouch.cpp:261
NexTouch::getObjName
const char * getObjName(void)
Get component name.
Definition: NexTouch.cpp:112
NexTouch::print
void print(void)
Print current object address,page id,component id, component name,pop event function address...
Definition: NexTouch.cpp:122
NexTouch::mainEventLoop
static uint8_t mainEventLoop(NexTouch **list)
Watting for Nextion's touch event.
Definition: NexTouch.cpp:26
+
disableTouchFocus
bool disableTouchFocus(void)
Disable all touch hot.
Definition: NexTouch.cpp:513
NexTouch::getCid
NexCid getCid(void)
Get component id.
Definition: NexTouch.cpp:102
+
setDefaultBrightness
bool setDefaultBrightness(uint8_t dimDefaultValue)
Set default backlight brightness value.
Definition: NexTouch.cpp:623
+
sendCurrentPageId
bool sendCurrentPageId(uint8_t *pageId)
Return current page id.
Definition: NexTouch.cpp:439
NexTouch.h
API of Nextion.
+
recoverySerialCommand
bool recoverySerialCommand(void)
Recovery serial instruction execution.
Definition: NexTouch.cpp:562
+
sleepMode
bool sleepMode(uint8_t mode)
Set device in sleep mode.
Definition: NexTouch.cpp:657
+
setCurrentBaudrate
bool setCurrentBaudrate(uint32_t baudrate)
Set current baudrate.
Definition: NexTouch.cpp:694
+
pauseSerialCommand
bool pauseSerialCommand(void)
Pause serial instruction execution.
Definition: NexTouch.cpp:537
NexTouch::recvRetNumber
static bool recvRetNumber(uint32_t *number, uint32_t timeout=500)
Receive uint32_t data.
Definition: NexTouch.cpp:356
NexTouch::recvRetString
static uint16_t recvRetString(char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data.
Definition: NexTouch.cpp:284
+
setCurrentBrightness
bool setCurrentBrightness(uint8_t dimValue)
Set current backlight brightness value.
Definition: NexTouch.cpp:588
NexTouch::recvRetCommandFinished
static bool recvRetCommandFinished(uint32_t timeout=100)
Command is executed successfully.
Definition: NexTouch.cpp:224
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
+
touchCalibration
bool touchCalibration(void)
Touch screen calibration.
Definition: NexTouch.cpp:489
diff --git a/doc/API-html/_nex_touch_8h.html b/doc/API-html/_nex_touch_8h.html index 06bab51..97385e6 100644 --- a/doc/API-html/_nex_touch_8h.html +++ b/doc/API-html/_nex_touch_8h.html @@ -56,6 +56,7 @@

API of Nextion. More...

#include <Arduino.h>
+#include "NexSerialConfig.h"

Go to the source code of this file.

@@ -73,6 +74,36 @@ Functions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
bool nexLoop (NexTouch **nexListenList)
 Call mainEventLoop,watting for Nextion's touch event. More...
 
bool sendCurrentPageId (uint8_t *pageId)
 Return current page id. More...
 
bool touchCalibration (void)
 Touch screen calibration. More...
 
bool disableTouchFocus (void)
 Disable all touch hot. More...
 
bool pauseSerialCommand (void)
 Pause serial instruction execution. More...
 
bool recoverySerialCommand (void)
 Recovery serial instruction execution. More...
 
bool setCurrentBrightness (uint8_t dimValue)
 Set current backlight brightness value. More...
 
bool setDefaultBrightness (uint8_t dimDefaultValue)
 Set default backlight brightness value. More...
 
bool sleepMode (uint8_t mode)
 Set device in sleep mode. More...
 
bool setCurrentBaudrate (uint32_t baudrate)
 Set current baudrate. More...
 
bool setDefaultBaudrate (uint32_t baudrate)
 Set default baudrate. More...
 

Detailed Description

API of Nextion.

@@ -83,6 +114,33 @@ This program is free software; you can redistribute it and/or modify it under th

Definition in file NexTouch.h.

Function Documentation

+ +
+
+ + + + + + + + +
bool disableTouchFocus (void )
+
+ +

Disable all touch hot.

+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 513 of file NexTouch.cpp.

+ +
+
@@ -106,7 +164,7 @@ This program is free software; you can redistribute it and/or modify it under th -

Definition at line 423 of file NexTouch.cpp.

+

Definition at line 409 of file NexTouch.cpp.

@@ -138,14 +196,293 @@ This program is free software; you can redistribute it and/or modify it under th -

Definition at line 440 of file NexTouch.cpp.

+

Definition at line 425 of file NexTouch.cpp.

+ + + + +
+
+ + + + + + + + +
bool pauseSerialCommand (void )
+
+ +

Pause serial instruction execution.

+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 537 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool recoverySerialCommand (void )
+
+ +

Recovery serial instruction execution.

+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 562 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool sendCurrentPageId (uint8_t * pageId)
+
+ +

Return current page id.

+
Parameters
+ + +
pageId- output parameter,to save page id.
+
+
+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 439 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool setCurrentBaudrate (uint32_t baudrate)
+
+ +

Set current baudrate.

+
Parameters
+ + +
baudrate- current baudrate,it surrpots 2400,4800,9600,19200,38400,57600,38400.
+
+
+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 694 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool setCurrentBrightness (uint8_t dimValue)
+
+ +

Set current backlight brightness value.

+
Parameters
+ + +
dimValue- current backlight brightness value.
+
+
+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 588 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool setDefaultBaudrate (uint32_t defaultBaudrate)
+
+ +

Set default baudrate.

+
Parameters
+ + +
defaultBaudrate- default baudrate,it surrpots 2400,4800,9600,19200,38400,57600,38400.
+
+
+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 726 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool setDefaultBrightness (uint8_t dimDefaultValue)
+
+ +

Set default backlight brightness value.

+
Parameters
+ + +
dimDefaultValue- default backlight brightness value.
+
+
+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 623 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool sleepMode (uint8_t mode)
+
+ +

Set device in sleep mode.

+
Parameters
+ + +
mode- 1:into sleep mode,0:exit sleep mode.
+
+
+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 657 of file NexTouch.cpp.

+ +
+
+ +
+
+ + + + + + + + +
bool touchCalibration (void )
+
+ +

Touch screen calibration.

+
Return values
+ + + +
true- success.
false- failed.
+
+
+ +

Definition at line 489 of file NexTouch.cpp.

diff --git a/doc/API-html/_nex_touch_8h_source.html b/doc/API-html/_nex_touch_8h_source.html index cd29b88..6d5e363 100644 --- a/doc/API-html/_nex_touch_8h_source.html +++ b/doc/API-html/_nex_touch_8h_source.html @@ -54,116 +54,132 @@
17 #define __NEXTOUCH_H__
18 #ifdef __cplusplus
19 #include <Arduino.h>
-
20 
+
20 #include "NexSerialConfig.h"
21 
-
22 /*Define debug serial*/
-
23 #define dbSerial Serial
+
22 typedef uint8_t NexPid;
+
23 typedef uint8_t NexCid;
24 
-
25 /*Define Nextion serial*/
-
26 #define nexSerial Serial2
-
27 
-
28 typedef uint8_t NexPid;
-
29 typedef uint8_t NexCid;
+
25 typedef enum {
+
26  NEX_EVENT_POP = 0x00,
+
27  NEX_EVENT_PUSH = 0x01,
+
28  NEX_EVENT_NULL
+
29 } NexEventType;
30 
-
31 typedef enum {
-
32  NEX_EVENT_POP = 0x00,
-
33  NEX_EVENT_PUSH = 0x01,
-
34  NEX_EVENT_NULL
-
35 } NexEventType;
-
36 
-
37 /*The first byte of Nextoin's return value*/
-
38 #define NEX_RET_CMD_FINISHED (0x01)
-
39 #define NEX_RET_EVENT_LAUNCHED (0x88)
-
40 #define NEX_RET_EVENT_UPGRADED (0x89)
-
41 #define NEX_RET_EVENT_TOUCH_HEAD (0x65)
-
42 #define NEX_RET_EVENT_POSITION_HEAD (0x67)
-
43 #define NEX_RET_EVENT_SLEEP_POSITION_HEAD (0x68)
-
44 #define NEX_RET_CURRENT_PAGE_ID_HEAD (0x66)
-
45 #define NEX_RET_STRING_HEAD (0x70)
-
46 #define NEX_RET_NUMBER_HEAD (0x71)
-
47 #define NEX_RET_INVALID_CMD (0x00)
-
48 #define NEX_RET_INVALID_COMPONENT_ID (0x02)
-
49 #define NEX_RET_INVALID_PAGE_ID (0x03)
-
50 #define NEX_RET_INVALID_PICTURE_ID (0x04)
-
51 #define NEX_RET_INVALID_FONT_ID (0x05)
-
52 #define NEX_RET_INVALID_BAUD (0x11)
-
53 #define NEX_RET_INVALID_VARIABLE (0x1A)
-
54 #define NEX_RET_INVALID_OPERATION (0x1B)
-
55 
-
56 
-
57 typedef void (*NexTouchEventCb)(void *ptr);
-
58 
-
63 class NexTouch
-
64 {
-
65 public: /* static methods */
-
66  static uint8_t mainEventLoop(NexTouch **list);
-
67  static void sendCommand(const char *cmd);
-
68  static bool recvRetCommandFinished(uint32_t timeout = 100);
-
69  static uint16_t recvRetString(char *buffer, uint16_t len, uint32_t timeout = 500);
-
70  static bool recvRetNumber(uint32_t *number, uint32_t timeout = 500);
-
71 
-
72 public: /* methods */
-
73  NexTouch(NexPid pid, NexCid cid, char *name,
-
74  NexTouchEventCb pop = NULL, void *pop_ptr = NULL,
-
75  NexTouchEventCb push = NULL, void *push_ptr = NULL);
-
76 
-
77  NexPid getPid(void);
-
78  NexCid getCid(void);
-
79  const char *getObjName(void);
-
80  void print(void);
-
81 
-
82 protected: /* static methods */
-
83  static bool setBrightness(uint32_t brightness);
-
84  static bool getBrightness(uint32_t *brightness);
+
31 /*The first byte of Nextoin's return value*/
+
32 #define NEX_RET_CMD_FINISHED (0x01)
+
33 #define NEX_RET_EVENT_LAUNCHED (0x88)
+
34 #define NEX_RET_EVENT_UPGRADED (0x89)
+
35 #define NEX_RET_EVENT_TOUCH_HEAD (0x65)
+
36 #define NEX_RET_EVENT_POSITION_HEAD (0x67)
+
37 #define NEX_RET_EVENT_SLEEP_POSITION_HEAD (0x68)
+
38 #define NEX_RET_CURRENT_PAGE_ID_HEAD (0x66)
+
39 #define NEX_RET_STRING_HEAD (0x70)
+
40 #define NEX_RET_NUMBER_HEAD (0x71)
+
41 #define NEX_RET_INVALID_CMD (0x00)
+
42 #define NEX_RET_INVALID_COMPONENT_ID (0x02)
+
43 #define NEX_RET_INVALID_PAGE_ID (0x03)
+
44 #define NEX_RET_INVALID_PICTURE_ID (0x04)
+
45 #define NEX_RET_INVALID_FONT_ID (0x05)
+
46 #define NEX_RET_INVALID_BAUD (0x11)
+
47 #define NEX_RET_INVALID_VARIABLE (0x1A)
+
48 #define NEX_RET_INVALID_OPERATION (0x1B)
+
49 
+
50 
+
51 typedef void (*NexTouchEventCb)(void *ptr);
+
52 
+
57 class NexTouch
+
58 {
+
59 public: /* static methods */
+
60  static uint8_t mainEventLoop(NexTouch **list);
+
61  static void sendCommand(const char *cmd);
+
62  static bool recvRetCommandFinished(uint32_t timeout = 100);
+
63  static uint16_t recvRetString(char *buffer, uint16_t len, uint32_t timeout = 500);
+
64  static bool recvRetNumber(uint32_t *number, uint32_t timeout = 500);
+
65 
+
66 public: /* methods */
+
67  NexTouch(NexPid pid, NexCid cid, char *name,
+
68  NexTouchEventCb pop = NULL, void *pop_ptr = NULL,
+
69  NexTouchEventCb push = NULL, void *push_ptr = NULL);
+
70 
+
71  NexPid getPid(void);
+
72  NexCid getCid(void);
+
73  const char *getObjName(void);
+
74  void print(void);
+
75 
+
76 protected: /* static methods */
+
77  static bool setBrightness(uint32_t brightness);
+
78  static bool getBrightness(uint32_t *brightness);
+
79 
+
80 protected: /* methods */
+
81  void attachPush(NexTouchEventCb push, void *ptr = NULL);
+
82  void detachPush(void);
+
83  void attachPop(NexTouchEventCb pop, void *ptr = NULL);
+
84  void detachPop(void);
85 
-
86 protected: /* methods */
-
87  void attachPush(NexTouchEventCb push, void *ptr = NULL);
-
88  void detachPush(void);
-
89  void attachPop(NexTouchEventCb pop, void *ptr = NULL);
-
90  void detachPop(void);
-
91 
-
92 private: /* static methods */
-
93  static void iterate(NexTouch **list, NexPid pid, NexCid cid, NexEventType event);
-
94 
-
95 private: /* methods */
-
96  void push(void);
-
97  void pop(void);
-
98 
-
99 private: /* static data */
-
100  static uint8_t __buffer[256];
-
101 
-
102 private: /* data */
-
103  NexPid pid; /* Page ID */
-
104  NexCid cid; /* Component ID */
-
105  char *name; /* An unique name */
-
106  NexTouchEventCb cbPush;
-
107  void *__cbpush_ptr;
-
108  NexTouchEventCb cbPop;
-
109  void *__cbpop_ptr;
-
110 };
-
111 
-
112 bool nexInit(void);
-
113 bool nexLoop(NexTouch **nexListenList);
-
114 
-
115 #endif /* #ifdef __cplusplus */
-
116 #endif /* #ifndef __NEXTOUCH_H__ */
+
86 private: /* static methods */
+
87  static void iterate(NexTouch **list, NexPid pid, NexCid cid, NexEventType event);
+
88 
+
89 private: /* methods */
+
90  void push(void);
+
91  void pop(void);
+
92 
+
93 private: /* static data */
+
94  static uint8_t __buffer[256];
+
95 
+
96 private: /* data */
+
97  NexPid pid; /* Page ID */
+
98  NexCid cid; /* Component ID */
+
99  char *name; /* An unique name */
+
100  NexTouchEventCb cbPush;
+
101  void *__cbpush_ptr;
+
102  NexTouchEventCb cbPop;
+
103  void *__cbpop_ptr;
+
104 };
+
105 
+
106 bool nexInit(void);
+
107 bool nexLoop(NexTouch **nexListenList);
+
108 bool sendCurrentPageId(uint8_t* pageId);
+
109 bool touchCalibration(void);
+
110 bool disableTouchFocus(void);
+
111 bool pauseSerialCommand(void);
+
112 bool recoverySerialCommand(void);
+
113 bool clearSerialSurplusCommand(void);
+
114 bool setCurrentBrightness(uint8_t dimValue);
+
115 bool setDefaultBrightness(uint8_t dimDefaultValue);
+
116 bool sleepMode(uint8_t mode);
+
117 bool setCurrentBaudrate(uint32_t baudrate);
+
118 bool setDefaultBaudrate(uint32_t baudrate);
+
119 
+
120 #endif /* #ifdef __cplusplus */
+
121 #endif /* #ifndef __NEXTOUCH_H__ */
+
setDefaultBaudrate
bool setDefaultBaudrate(uint32_t baudrate)
Set default baudrate.
Definition: NexTouch.cpp:726
NexTouch::getPid
NexPid getPid(void)
Get page id.
Definition: NexTouch.cpp:92
+
sleepMode
bool sleepMode(uint8_t mode)
Set device in sleep mode.
Definition: NexTouch.cpp:657
NexTouch::NexTouch
NexTouch(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL)
Constructor of Nextouch.
Definition: NexTouch.cpp:74
-
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:423
+
NexSerialConfig.h
Serial configure.
+
setCurrentBaudrate
bool setCurrentBaudrate(uint32_t baudrate)
Set current baudrate.
Definition: NexTouch.cpp:694
+
setDefaultBrightness
bool setDefaultBrightness(uint8_t dimDefaultValue)
Set default backlight brightness value.
Definition: NexTouch.cpp:623
+
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:409
NexTouch::sendCommand
static void sendCommand(const char *cmd)
Send command to Nextion.
Definition: NexTouch.cpp:261
NexTouch::getObjName
const char * getObjName(void)
Get component name.
Definition: NexTouch.cpp:112
+
disableTouchFocus
bool disableTouchFocus(void)
Disable all touch hot.
Definition: NexTouch.cpp:513
+
pauseSerialCommand
bool pauseSerialCommand(void)
Pause serial instruction execution.
Definition: NexTouch.cpp:537
NexTouch::print
void print(void)
Print current object address,page id,component id, component name,pop event function address...
Definition: NexTouch.cpp:122
NexTouch::mainEventLoop
static uint8_t mainEventLoop(NexTouch **list)
Watting for Nextion's touch event.
Definition: NexTouch.cpp:26
+
touchCalibration
bool touchCalibration(void)
Touch screen calibration.
Definition: NexTouch.cpp:489
NexTouch::getCid
NexCid getCid(void)
Get component id.
Definition: NexTouch.cpp:102
-
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
+
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:425
+
setCurrentBrightness
bool setCurrentBrightness(uint8_t dimValue)
Set current backlight brightness value.
Definition: NexTouch.cpp:588
NexTouch::recvRetNumber
static bool recvRetNumber(uint32_t *number, uint32_t timeout=500)
Receive uint32_t data.
Definition: NexTouch.cpp:356
NexTouch::recvRetString
static uint16_t recvRetString(char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data.
Definition: NexTouch.cpp:284
+
recoverySerialCommand
bool recoverySerialCommand(void)
Recovery serial instruction execution.
Definition: NexTouch.cpp:562
+
sendCurrentPageId
bool sendCurrentPageId(uint8_t *pageId)
Return current page id.
Definition: NexTouch.cpp:439
NexTouch::recvRetCommandFinished
static bool recvRetCommandFinished(uint32_t timeout=100)
Command is executed successfully.
Definition: NexTouch.cpp:224
-
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:63
+
NexTouch
Root Class of Nextion Components.
Definition: NexTouch.h:57
diff --git a/doc/API-html/annotated.html b/doc/API-html/annotated.html index 120d96b..6b1097c 100644 --- a/doc/API-html/annotated.html +++ b/doc/API-html/annotated.html @@ -67,7 +67,7 @@ diff --git a/doc/API-html/class_nex_button-members.html b/doc/API-html/class_nex_button-members.html index c0fd45f..68f790d 100644 --- a/doc/API-html/class_nex_button-members.html +++ b/doc/API-html/class_nex_button-members.html @@ -72,7 +72,7 @@ diff --git a/doc/API-html/class_nex_button.html b/doc/API-html/class_nex_button.html index 5655eab..59a3436 100644 --- a/doc/API-html/class_nex_button.html +++ b/doc/API-html/class_nex_button.html @@ -249,7 +249,7 @@ Additional Inherited Members diff --git a/doc/API-html/class_nex_hotspot-members.html b/doc/API-html/class_nex_hotspot-members.html index e1132f0..f416663 100644 --- a/doc/API-html/class_nex_hotspot-members.html +++ b/doc/API-html/class_nex_hotspot-members.html @@ -72,7 +72,7 @@ diff --git a/doc/API-html/class_nex_hotspot.html b/doc/API-html/class_nex_hotspot.html index 6a93d85..55853f0 100644 --- a/doc/API-html/class_nex_hotspot.html +++ b/doc/API-html/class_nex_hotspot.html @@ -215,7 +215,7 @@ Additional Inherited Members diff --git a/doc/API-html/class_nex_page-members.html b/doc/API-html/class_nex_page-members.html index c77954a..ea98ce0 100644 --- a/doc/API-html/class_nex_page-members.html +++ b/doc/API-html/class_nex_page-members.html @@ -71,7 +71,7 @@ diff --git a/doc/API-html/class_nex_page.html b/doc/API-html/class_nex_page.html index 052b940..33a39cd 100644 --- a/doc/API-html/class_nex_page.html +++ b/doc/API-html/class_nex_page.html @@ -201,7 +201,7 @@ Additional Inherited Members diff --git a/doc/API-html/class_nex_picture-members.html b/doc/API-html/class_nex_picture-members.html index d17c635..2cd991f 100644 --- a/doc/API-html/class_nex_picture-members.html +++ b/doc/API-html/class_nex_picture-members.html @@ -72,7 +72,7 @@ diff --git a/doc/API-html/class_nex_picture.html b/doc/API-html/class_nex_picture.html index eae0850..3440ee3 100644 --- a/doc/API-html/class_nex_picture.html +++ b/doc/API-html/class_nex_picture.html @@ -244,7 +244,7 @@ Additional Inherited Members diff --git a/doc/API-html/class_nex_pointer-members.html b/doc/API-html/class_nex_pointer-members.html index 9532ec1..8673dd9 100644 --- a/doc/API-html/class_nex_pointer-members.html +++ b/doc/API-html/class_nex_pointer-members.html @@ -70,7 +70,7 @@ diff --git a/doc/API-html/class_nex_pointer.html b/doc/API-html/class_nex_pointer.html index 67d46a5..81b431d 100644 --- a/doc/API-html/class_nex_pointer.html +++ b/doc/API-html/class_nex_pointer.html @@ -199,7 +199,7 @@ Additional Inherited Members diff --git a/doc/API-html/class_nex_progress_bar-members.html b/doc/API-html/class_nex_progress_bar-members.html index 23aa697..1282688 100644 --- a/doc/API-html/class_nex_progress_bar-members.html +++ b/doc/API-html/class_nex_progress_bar-members.html @@ -70,7 +70,7 @@ diff --git a/doc/API-html/class_nex_progress_bar.html b/doc/API-html/class_nex_progress_bar.html index d118707..945d042 100644 --- a/doc/API-html/class_nex_progress_bar.html +++ b/doc/API-html/class_nex_progress_bar.html @@ -199,7 +199,7 @@ Additional Inherited Members diff --git a/doc/API-html/class_nex_slice-members.html b/doc/API-html/class_nex_slice-members.html index 4f3a848..a5614b3 100644 --- a/doc/API-html/class_nex_slice-members.html +++ b/doc/API-html/class_nex_slice-members.html @@ -70,7 +70,7 @@ diff --git a/doc/API-html/class_nex_slice.html b/doc/API-html/class_nex_slice.html index f56f9d1..97b1bbc 100644 --- a/doc/API-html/class_nex_slice.html +++ b/doc/API-html/class_nex_slice.html @@ -170,7 +170,7 @@ Additional Inherited Members diff --git a/doc/API-html/class_nex_text-members.html b/doc/API-html/class_nex_text-members.html index 6059e6e..e361b72 100644 --- a/doc/API-html/class_nex_text-members.html +++ b/doc/API-html/class_nex_text-members.html @@ -72,7 +72,7 @@ diff --git a/doc/API-html/class_nex_text.html b/doc/API-html/class_nex_text.html index cf4fed9..c4e17bc 100644 --- a/doc/API-html/class_nex_text.html +++ b/doc/API-html/class_nex_text.html @@ -248,7 +248,7 @@ Additional Inherited Members diff --git a/doc/API-html/class_nex_touch-members.html b/doc/API-html/class_nex_touch-members.html index 79b363d..21c1bee 100644 --- a/doc/API-html/class_nex_touch-members.html +++ b/doc/API-html/class_nex_touch-members.html @@ -67,7 +67,7 @@ diff --git a/doc/API-html/class_nex_touch.html b/doc/API-html/class_nex_touch.html index 53ce127..b756ebb 100644 --- a/doc/API-html/class_nex_touch.html +++ b/doc/API-html/class_nex_touch.html @@ -118,7 +118,7 @@ Static Public Member Functions

Root Class of Nextion Components.

Examples:
CompButton.ino, CompHotspot.ino, CompPage.ino, CompPicture.ino, CompPointer.ino, CompProgressBar.ino, CompSlice.ino, and CompText.ino.
-

Definition at line 63 of file NexTouch.h.

+

Definition at line 57 of file NexTouch.h.

Constructor & Destructor Documentation

@@ -477,7 +477,7 @@ Static Public Member Functions
diff --git a/doc/API-html/classes.html b/doc/API-html/classes.html index 87a8170..8ec100f 100644 --- a/doc/API-html/classes.html +++ b/doc/API-html/classes.html @@ -63,7 +63,7 @@ diff --git a/doc/API-html/dir_0726b97e666c2e7f518aadd1fe5118dc.html b/doc/API-html/dir_0726b97e666c2e7f518aadd1fe5118dc.html index 7707294..54d1266 100644 --- a/doc/API-html/dir_0726b97e666c2e7f518aadd1fe5118dc.html +++ b/doc/API-html/dir_0726b97e666c2e7f518aadd1fe5118dc.html @@ -56,7 +56,7 @@ Files diff --git a/doc/API-html/dir_376a8598cfd3d58455c161124a3e8051.html b/doc/API-html/dir_376a8598cfd3d58455c161124a3e8051.html index 4c4d428..ec4b29a 100644 --- a/doc/API-html/dir_376a8598cfd3d58455c161124a3e8051.html +++ b/doc/API-html/dir_376a8598cfd3d58455c161124a3e8051.html @@ -56,7 +56,7 @@ Files diff --git a/doc/API-html/dir_7962cac16a99e8bbaaea18abede03fcb.html b/doc/API-html/dir_7962cac16a99e8bbaaea18abede03fcb.html index 741b62e..f319c7c 100644 --- a/doc/API-html/dir_7962cac16a99e8bbaaea18abede03fcb.html +++ b/doc/API-html/dir_7962cac16a99e8bbaaea18abede03fcb.html @@ -56,7 +56,7 @@ Files diff --git a/doc/API-html/dir_9bbf8342b0f9a157b7af08fe1412fc17.html b/doc/API-html/dir_9bbf8342b0f9a157b7af08fe1412fc17.html index 65b7088..1c83635 100644 --- a/doc/API-html/dir_9bbf8342b0f9a157b7af08fe1412fc17.html +++ b/doc/API-html/dir_9bbf8342b0f9a157b7af08fe1412fc17.html @@ -56,7 +56,7 @@ Files diff --git a/doc/API-html/dir_c918e8bf3fc71f849978cdb0d900e61c.html b/doc/API-html/dir_c918e8bf3fc71f849978cdb0d900e61c.html index dd7fa88..038dad2 100644 --- a/doc/API-html/dir_c918e8bf3fc71f849978cdb0d900e61c.html +++ b/doc/API-html/dir_c918e8bf3fc71f849978cdb0d900e61c.html @@ -56,7 +56,7 @@ Files diff --git a/doc/API-html/dir_ce36ac18ad3deaf5eae0bd2e09775a7d.html b/doc/API-html/dir_ce36ac18ad3deaf5eae0bd2e09775a7d.html index 7c69329..9a2f0a7 100644 --- a/doc/API-html/dir_ce36ac18ad3deaf5eae0bd2e09775a7d.html +++ b/doc/API-html/dir_ce36ac18ad3deaf5eae0bd2e09775a7d.html @@ -56,7 +56,7 @@ Files diff --git a/doc/API-html/dir_d28a4824dc47e487b107a5db32ef43c4.html b/doc/API-html/dir_d28a4824dc47e487b107a5db32ef43c4.html index 8d75edb..b952b15 100644 --- a/doc/API-html/dir_d28a4824dc47e487b107a5db32ef43c4.html +++ b/doc/API-html/dir_d28a4824dc47e487b107a5db32ef43c4.html @@ -70,7 +70,7 @@ Directories diff --git a/doc/API-html/dir_f3d39c87bc262720c50d5e3885667b8a.html b/doc/API-html/dir_f3d39c87bc262720c50d5e3885667b8a.html index a61e6b1..b41bbcb 100644 --- a/doc/API-html/dir_f3d39c87bc262720c50d5e3885667b8a.html +++ b/doc/API-html/dir_f3d39c87bc262720c50d5e3885667b8a.html @@ -56,7 +56,7 @@ Files diff --git a/doc/API-html/dir_f76977d9ffe8ddf3ad01f3d689aa5df4.html b/doc/API-html/dir_f76977d9ffe8ddf3ad01f3d689aa5df4.html index 4372684..2bef0b5 100644 --- a/doc/API-html/dir_f76977d9ffe8ddf3ad01f3d689aa5df4.html +++ b/doc/API-html/dir_f76977d9ffe8ddf3ad01f3d689aa5df4.html @@ -56,7 +56,7 @@ Files diff --git a/doc/API-html/examples.html b/doc/API-html/examples.html index 42bdbf4..745d428 100644 --- a/doc/API-html/examples.html +++ b/doc/API-html/examples.html @@ -64,7 +64,7 @@ diff --git a/doc/API-html/files.html b/doc/API-html/files.html index 58eefd1..202786b 100644 --- a/doc/API-html/files.html +++ b/doc/API-html/files.html @@ -80,18 +80,19 @@  NexPointer.h  NexProgressBar.cppAPI of NexProgressBar  NexProgressBar.hAPI of NexProgressBar - NexSlice.cppAPI of NexSlice - NexSlice.hAPI of NexSlice - NexText.cppAPI of NexText - NexText.hAPI of NexText - NexTouch.cppAPI of Nextion - NexTouch.hAPI of Nextion + NexSerialConfig.hSerial configure + NexSlice.cppAPI of NexSlice + NexSlice.hAPI of NexSlice + NexText.cppAPI of NexText + NexText.hAPI of NexText + NexTouch.cppAPI of Nextion + NexTouch.hAPI of Nextion diff --git a/doc/API-html/functions.html b/doc/API-html/functions.html index 0651ed0..05d25e7 100644 --- a/doc/API-html/functions.html +++ b/doc/API-html/functions.html @@ -201,7 +201,7 @@ diff --git a/doc/API-html/functions_func.html b/doc/API-html/functions_func.html index 16cb051..827810a 100644 --- a/doc/API-html/functions_func.html +++ b/doc/API-html/functions_func.html @@ -201,7 +201,7 @@ diff --git a/doc/API-html/globals.html b/doc/API-html/globals.html index 83069ed..22d8d42 100644 --- a/doc/API-html/globals.html +++ b/doc/API-html/globals.html @@ -52,6 +52,10 @@
Here is a list of all documented file members with links to the documentation:
diff --git a/doc/API-html/globals_func.html b/doc/API-html/globals_func.html index 1457b87..9b40a2d 100644 --- a/doc/API-html/globals_func.html +++ b/doc/API-html/globals_func.html @@ -52,6 +52,10 @@
 
diff --git a/doc/API-html/hierarchy.html b/doc/API-html/hierarchy.html index 668283b..91b9fbb 100644 --- a/doc/API-html/hierarchy.html +++ b/doc/API-html/hierarchy.html @@ -67,7 +67,7 @@ diff --git a/doc/API-html/index.hhc b/doc/API-html/index.hhc index e5c8d8f..92f5dc2 100644 --- a/doc/API-html/index.hhc +++ b/doc/API-html/index.hhc @@ -194,6 +194,9 @@
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • diff --git a/doc/API-html/index.hhk b/doc/API-html/index.hhk index 95a0e93..ba863d4 100644 --- a/doc/API-html/index.hhk +++ b/doc/API-html/index.hhk @@ -24,6 +24,11 @@
  • +
  • +
  • @@ -109,13 +114,33 @@
  • +
  • +
  • +
  • +
  • +
  • + +
  • + +
  • + +
  • + +
  • +
  • +
  • + +
  • + diff --git a/doc/API-html/index.hhp b/doc/API-html/index.hhp index 82ae6a3..c7a7d9e 100644 --- a/doc/API-html/index.hhp +++ b/doc/API-html/index.hhp @@ -41,6 +41,7 @@ _nex_pointer_8cpp_source.html _nex_pointer_8h_source.html _nex_progress_bar_8cpp_source.html _nex_progress_bar_8h_source.html +_nex_serial_config_8h_source.html _nex_slice_8cpp_source.html _nex_slice_8h_source.html _nex_text_8cpp_source.html @@ -58,6 +59,7 @@ _nex_picture_8cpp.html _nex_picture_8h.html _nex_progress_bar_8cpp.html _nex_progress_bar_8h.html +_nex_serial_config_8h.html _nex_slice_8cpp.html _nex_slice_8h.html _nex_text_8cpp.html diff --git a/doc/API-html/index.html b/doc/API-html/index.html index c60c0e5..98812f8 100644 --- a/doc/API-html/index.html +++ b/doc/API-html/index.html @@ -51,7 +51,7 @@

    Source

    Latest source code can be download at https://github.com/itead/ITEADLIB_Arduino_Nextion.

    You can clone it by:

    git clone https://github.com/itead/ITEADLIB_Arduino_Nextion
    -

    Documentation

    +

    Documentation

    Online API documentation can be reached at http://docs.iteadstudio.com/ITEADLIB_Arduino_Nextion/.

    Offline API documentation can be found under directory doc.

    Hareware requirement

    @@ -59,12 +59,16 @@
  • RAM: not less than 2KBytes
  • Serial: two serial (communication and debug)
  • -

    Suppported Mainboards:

    +

    Serial configuration

    +

    If you want to change the default serial to debug or communicate with Nextion ,you need to modify the line in file NexSerialConfig.h:

    #define dbSerial Serial    ---> #define dbSerial Serialxxx
    +#define nexSerial Serial2  ---> #define dbSerial Serialxxx
    +

    If you want to close the debug information,you need to modify the line in file NexSerialConfig.h:

    #define DEBUG_SERIAL_ENABLE ---> //#define DEBUG_SERIAL_ENABLE
    +

    Suppported Mainboards:

    -

    DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004

    Copyright (C) 2014 ITEAD Studio

    Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

       DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
    @@ -74,7 +78,7 @@
      
     
     
    diff --git a/doc/API-html/md_readme.html b/doc/API-html/md_readme.html
    index 1b23470..fc0dbca 100644
    --- a/doc/API-html/md_readme.html
    +++ b/doc/API-html/md_readme.html
    @@ -46,7 +46,7 @@
     
    diff --git a/doc/API-html/pages.html b/doc/API-html/pages.html index 9c60591..30d6457 100644 --- a/doc/API-html/pages.html +++ b/doc/API-html/pages.html @@ -51,7 +51,7 @@ diff --git a/doc/API-html/readme_8md_source.html b/doc/API-html/readme_8md_source.html index 51b6de1..6546955 100644 --- a/doc/API-html/readme_8md_source.html +++ b/doc/API-html/readme_8md_source.html @@ -71,47 +71,56 @@
    20 You can clone it by:
    21 
    22  git clone https://github.com/itead/ITEADLIB_Arduino_Nextion
    -
    23 # Documentation
    -
    24 Online API documentation can be reached at <http://docs.iteadstudio.com/ITEADLIB_Arduino_Nextion/>.
    -
    25 
    -
    26 Offline API documentation can be found under directory
    -
    27 [doc](https://github.com/itead/ITEADLIB_Arduino_Nextion/tree/master/doc).
    -
    28 
    -
    29 # Hareware requirement
    -
    30 
    -
    31  - RAM: not less than 2KBytes
    -
    32  - Serial: two serial (communication and debug)
    -
    33 
    -
    34 # Suppported Mainboards:
    -
    35 
    -
    36  - Iteaduino MEGA2560
    -
    37  - Arduino MEGA2560
    +
    23 
    +
    24 # Documentation
    +
    25 Online API documentation can be reached at <http://docs.iteadstudio.com/ITEADLIB_Arduino_Nextion/>.
    +
    26 
    +
    27 Offline API documentation can be found under directory
    +
    28 [doc](https://github.com/itead/ITEADLIB_Arduino_Nextion/tree/master/doc).
    +
    29 
    +
    30 # Hareware requirement
    +
    31 
    +
    32  - RAM: not less than 2KBytes
    +
    33  - Serial: two serial (communication and debug)
    +
    34 
    +
    35 # Serial configuration
    +
    36 
    +
    37 If you want to change the default serial to debug or communicate with Nextion ,you need to modify the line in file NexSerialConfig.h:
    38 
    -
    39 
    -
    40 -------------------------------------------------------------------------------
    -
    41 
    +
    39  #define dbSerial Serial ---> #define dbSerial Serialxxx
    +
    40  #define nexSerial Serial2 ---> #define dbSerial Serialxxx
    +
    41 If you want to close the debug information,you need to modify the line in file NexSerialConfig.h:
    42 
    -
    43  DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    -
    44  Version 2, December 2004
    +
    43  #define DEBUG_SERIAL_ENABLE ---> //#define DEBUG_SERIAL_ENABLE
    +
    44 # Suppported Mainboards:
    45 
    -
    46  Copyright (C) 2014 ITEAD Studio
    -
    47 
    -
    48  Everyone is permitted to copy and distribute verbatim or modified
    -
    49  copies of this license document, and changing it is allowed as long
    -
    50  as the name is changed.
    +
    46  - Iteaduino MEGA2560
    +
    47  - Arduino MEGA2560
    +
    48 
    +
    49 -------------------------------------------------------------------------------
    +
    50 
    51 
    -
    52  DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    -
    53 
    -
    54  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    -
    55 
    -
    56  0. You just DO WHAT THE FUCK YOU WANT TO.
    -
    57 
    -
    58 
    -
    59 -------------------------------------------------------------------------------
    +
    52  DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    +
    53  Version 2, December 2004
    +
    54 
    +
    55  Copyright (C) 2014 ITEAD Studio
    +
    56 
    +
    57  Everyone is permitted to copy and distribute verbatim or modified
    +
    58  copies of this license document, and changing it is allowed as long
    +
    59  as the name is changed.
    +
    60 
    +
    61  DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    +
    62 
    +
    63  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    +
    64 
    +
    65  0. You just DO WHAT THE FUCK YOU WANT TO.
    +
    66 
    +
    67 
    +
    68 -------------------------------------------------------------------------------
    diff --git a/doc/API.chm b/doc/API.chm index f8a3877..46c2cf4 100644 Binary files a/doc/API.chm and b/doc/API.chm differ diff --git a/readme.md b/readme.md index a5affbd..1fe44b5 100644 --- a/readme.md +++ b/readme.md @@ -36,9 +36,11 @@ Offline API documentation can be found under directory If you want to change the default serial to debug or communicate with Nextion ,you need to modify the line in file NexSerialConfig.h: - #define dbSerial Serial - #define nexSerial Serial2 + #define dbSerial Serial ---> #define dbSerial Serialxxx + #define nexSerial Serial2 ---> #define dbSerial Serialxxx +If you want to close the debug information,you need to modify the line in file NexSerialConfig.h: + #define DEBUG_SERIAL_ENABLE ---> //#define DEBUG_SERIAL_ENABLE # Suppported Mainboards: - Iteaduino MEGA2560