| Documentation For Arduino users

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

- File List
- File Members

CompPicture.ino
1
17 #include "Nextion.h"
18
19 NexPicture p0 = NexPicture(0, 1, "p0");
20
21 NexTouch *nex_listen_list[] =
22 {
23 &p0,
24 NULL
25 };
26
27 void p0PopCallback(void *ptr)
28 {
29 uint32_t number = 0;
30 dbSerialPrintln("p0PopCallback");
31
32 p0.getPic(&number);
33
34 if (number == 1)
35 {
36 number = 2;
37 }
38 else
39 {
40 number = 1;
41 }
42
43 p0.setPic(number);
44 }
45
46
47 void setup(void)
48 {
49 nexInit();
50 p0.attachPop(p0PopCallback);
51 dbSerialPrintln("setup done");
52 }
53
54 void loop(void)
55 {
56 nexLoop(nex_listen_list);
57 }
58
nexLoop
void nexLoop(NexTouch *nex_listen_list[])
Listen touch event and calling callbacks attached before.
Definition: NexHardware.cpp:235
NexPicture::setPic
bool setPic(uint32_t number)
Set picture's number.
Definition: NexPicture.cpp:32
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
NexPicture
NexPicture component.
Definition: NexPicture.h:30
Nextion.h
The header file including all other header files provided by this library.
NexPicture::getPic
bool getPic(uint32_t *number)
Get picture's number.
Definition: NexPicture.cpp:23
NexTouch
Father class of the components with touch events.
Definition: NexTouch.h:53