Documentation: examples/CompPage/CompPage_v0_32.ino Source File

| Documentation For Arduino users

- Main Page
- Related Pages
- Modules
- Classes
- Files
- Examples

- File List
- File Members

CompPage_v0_32.ino
1
19 #include "Nextion.h"
20
21 NexPage page0 = NexPage(0, 0, "page0");
22 NexPage page1 = NexPage(1, 0, "page1");
23 NexPage page2 = NexPage(2, 0, "page2");
24 NexPage page3 = NexPage(3, 0, "page3");
25
26 NexTouch *nex_listen_list[] =
27 {
28 &page0,
29 &page1,
30 &page2,
31 &page3,
32 NULL
33 };
34
35 void page0PopCallback(void *ptr)
36 {
37 dbSerialPrintln("page0PopCallback");
38 page1.show();
39 }
40
41 void page1PopCallback(void *ptr)
42 {
43 dbSerialPrintln("page1PopCallback");
44 page2.show();
45 }
46
47 void page2PopCallback(void *ptr)
48 {
49 dbSerialPrintln("page2PopCallback");
50 page3.show();
51 }
52
53 void page3PopCallback(void *ptr)
54 {
55 dbSerialPrintln("page3PopCallback");
56 page0.show();
57 }
58
59 void setup(void)
60 {
61 nexInit();
62 dbSerialPrintln("setup begin");
63
64 page0.attachPop(page0PopCallback);
65 page1.attachPop(page1PopCallback);
66 page2.attachPop(page2PopCallback);
67 page3.attachPop(page3PopCallback);
68
69 dbSerialPrintln("setup end");
70 }
71
72 void loop(void)
73 {
74 nexLoop(nex_listen_list);
75 }
nexLoop
void nexLoop(NexTouch *nex_listen_list[])
Listen touch event and calling callbacks attached before.
Definition: NexHardware.cpp:235
NexPage::show
bool show(void)
Show itself.
Definition: NexPage.cpp:23
NexTouch::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Attach an callback function of pop touch event.
Definition: NexTouch.cpp:39
nexInit
bool nexInit(void)
Init Nextion.
Definition: NexHardware.cpp:220
NexPage
A special component , which can contain other components such as NexButton, NexText and NexWaveform...
Definition: NexPage.h:31
Nextion.h
The header file including all other header files provided by this library.
NexTouch
Father class of the components with touch events.
Definition: NexTouch.h:53