| Documentation For Arduino users

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

- File List
- File Members

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