API: readme

API
For Arduino developers
  • Main Page
  • Related Pages
  • Classes
  • Files
  • Examples
readme
Generated on Thu Jul 16 2015 10:59:03 for API by doxygen 1.8.7


API: Class List

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
C NexButton | NexButton,subclass of NexTouch,provides simple methods to control button component
C NexHotspot | NexHotspot,subclass of NexTouch,provides simple methods to control hotspot component
C NexPage | NexPage,subclass of NexTouch,provides simple methods to control page component
C NexPicture | NexPicture,subclass of NexTouch,provides simple methods to control picture component
C NexPointer | NexPointer,subclass of NexTouch,provides simple methods to control pointer component
C NexProgressBar | NexProgressBar,subclass of NexTouch,provides simple methods to control progress bar component
C NexSlice | NexSlice,subclass of NexTouch,provides simple methods to control slice component
C NexText | NexText,subclass of NexTouch,provides simple methods to control text component
C NexTouch | Root Class of Nextion Components


API: NexButton Class Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | List of all members
NexButton Class Reference

NexButton,subclass of NexTouch,provides simple methods to control button component. More...

#include <NexButton.h>

Inheritance diagram for NexButton:
NexTouch

Public Member Functions

NexButton (NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
void | attachPop (NexTouchEventCb pop, void *ptr=NULL)
Register button pop callback function. More...
void | detachPop (void)
Unload button pop callback function.
uint16_t | getText (char *buffer, uint16_t len)
Get text value from button component. More...
bool | setText (const char *buffer)
Set text value of button component. More...
- Public Member Functions inherited from 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. More...
NexPid | getPid (void)
Get page id. More...
NexCid | getCid (void)
Get component id. More...
const char * | getObjName (void)
Get component name. More...
void | print (void)
Print current object address,page id,component id, component name,pop event function address,push event function address.

Additional Inherited Members

- Static Public Member Functions inherited from NexTouch
static uint8_t | mainEventLoop (NexTouch **list)
Watting for Nextion's touch event. More...
static void | sendCommand (const char *cmd)
Send command to Nextion. More...
static bool | recvRetCommandFinished (uint32_t timeout=100)
Command is executed successfully. More...
static uint16_t | recvRetString (char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data. More...
static bool | recvRetNumber (uint32_t *number, uint32_t timeout=500)
Receive uint32_t data. More...

Detailed Description

NexButton,subclass of NexTouch,provides simple methods to control button component.

Examples:
CompButton.ino, CompPointer.ino, CompProgressBar.ino, and CompText.ino.

Definition at line 25 of file NexButton.h.

Member Function Documentation

void NexButton::attachPop | ( | NexTouchEventCb | pop,
 |  | void * | ptr = NULL
 | ) |  |

Register button pop callback function.

Parameters
pop | - the pointer to button pop callback function.
ptr | - the parameter to be transmitted to button pop callback function.
Examples:
CompButton.ino, CompPointer.ino, and CompProgressBar.ino.

Definition at line 70 of file NexButton.cpp.

uint16_t NexButton::getText | ( | char * | buffer,
 |  | uint16_t | len
 | ) |  |

Get text value from button component.

Parameters
buffer | - text buffer.
len | - text buffer length.
Returns
the text buffer length
Examples:
CompButton.ino.

Definition at line 35 of file NexButton.cpp.

bool NexButton::setText ( const char * buffer )

Set text value of button component.

Parameters
buffer - text buffer.
Return values
true | - success.
false | - failed.
Examples:
CompButton.ino.

Definition at line 53 of file NexButton.cpp.

The documentation for this class was generated from the following files:
  • NexButton.h
  • NexButton.cpp


API: NexHotspot Class Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | List of all members
NexHotspot Class Reference

NexHotspot,subclass of NexTouch,provides simple methods to control hotspot component. More...

#include <NexHotspot.h>

Inheritance diagram for NexHotspot:
NexTouch

Public Member Functions

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.
void | attachPush (NexTouchEventCb push, void *ptr=NULL)
Register hotspot push callback function. More...
void | detachPush (void)
Unload hotsopt push callback function.
void | attachPop (NexTouchEventCb pop, void *ptr=NULL)
Register hotspot pop callback function. More...
void | detachPop (void)
Unload hotsopt pop callback function.
- Public Member Functions inherited from 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. More...
NexPid | getPid (void)
Get page id. More...
NexCid | getCid (void)
Get component id. More...
const char * | getObjName (void)
Get component name. More...
void | print (void)
Print current object address,page id,component id, component name,pop event function address,push event function address.

Additional Inherited Members

- Static Public Member Functions inherited from NexTouch
static uint8_t | mainEventLoop (NexTouch **list)
Watting for Nextion's touch event. More...
static void | sendCommand (const char *cmd)
Send command to Nextion. More...
static bool | recvRetCommandFinished (uint32_t timeout=100)
Command is executed successfully. More...
static uint16_t | recvRetString (char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data. More...
static bool | recvRetNumber (uint32_t *number, uint32_t timeout=500)
Receive uint32_t data. More...

Detailed Description

NexHotspot,subclass of NexTouch,provides simple methods to control hotspot component.

Examples:
CompHotspot.ino.

Definition at line 25 of file NexHotspot.h.

Member Function Documentation

void NexHotspot::attachPop | ( | NexTouchEventCb | pop,
 |  | void * | ptr = NULL
 | ) |  |

Register hotspot pop callback function.

Parameters
pop | - the pointer to hotspot pot callback function.
ptr | - the parameter to be transmitted to hotspot pop callback function.
Examples:
CompHotspot.ino.

Definition at line 55 of file NexHotspot.cpp.

void NexHotspot::attachPush | ( | NexTouchEventCb | push,
 |  | void * | ptr = NULL
 | ) |  |

Register hotspot push callback function.

Parameters
push | - the pointer to hotspot push callback function.
ptr | - the parameter to be transmitted to hotspot push callback function.
Examples:
CompHotspot.ino.

Definition at line 35 of file NexHotspot.cpp.

The documentation for this class was generated from the following files:
  • NexHotspot.h
  • NexHotspot.cpp


API: NexPage Class Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | List of all members
NexPage Class Reference

NexPage,subclass of NexTouch,provides simple methods to control page component. More...

#include <NexPage.h>

Inheritance diagram for NexPage:
NexTouch

Public Member Functions

NexPage (NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
bool | show (void)
Change page. More...
void | attachPop (NexTouchEventCb pop, void *ptr=NULL)
Register page pop callback function. More...
void | detachPop (void)
Unload page pop callback function.
- Public Member Functions inherited from 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. More...
NexPid | getPid (void)
Get page id. More...
NexCid | getCid (void)
Get component id. More...
const char * | getObjName (void)
Get component name. More...
void | print (void)
Print current object address,page id,component id, component name,pop event function address,push event function address.

Additional Inherited Members

- Static Public Member Functions inherited from NexTouch
static uint8_t | mainEventLoop (NexTouch **list)
Watting for Nextion's touch event. More...
static void | sendCommand (const char *cmd)
Send command to Nextion. More...
static bool | recvRetCommandFinished (uint32_t timeout=100)
Command is executed successfully. More...
static uint16_t | recvRetString (char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data. More...
static bool | recvRetNumber (uint32_t *number, uint32_t timeout=500)
Receive uint32_t data. More...

Detailed Description

NexPage,subclass of NexTouch,provides simple methods to control page component.

Examples:
CompPage.ino.

Definition at line 25 of file NexPage.h.

Member Function Documentation

void NexPage::attachPop | ( | NexTouchEventCb | pop,
 |  | void * | ptr = NULL
 | ) |  |

Register page pop callback function.

Parameters
pop | - the pointer to page pop callback function.
ptr | - the parameter to be transmitted to page pop callback function.
Examples:
CompPage.ino.

Definition at line 55 of file NexPage.cpp.

bool NexPage::show ( void )

Change page.

Return values
true | - success.
false | - failed.
Examples:
CompPage.ino.

Definition at line 33 of file NexPage.cpp.

The documentation for this class was generated from the following files:
  • NexPage.h
  • NexPage.cpp


API: NexPicture Class Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | List of all members
NexPicture Class Reference

NexPicture,subclass of NexTouch,provides simple methods to control picture component. More...

#include <NexPicture.h>

Inheritance diagram for NexPicture:
NexTouch

Public Member Functions

NexPicture (NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
void | attachPop (NexTouchEventCb pop, void *ptr=NULL)
Register picture pop callback function. More...
void | detachPop (void)
Unload picture pop callback function.
bool | getPic (uint32_t *number)
Get picture's number. More...
bool | setPic (uint32_t number)
Set picture's number. More...
- Public Member Functions inherited from 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. More...
NexPid | getPid (void)
Get page id. More...
NexCid | getCid (void)
Get component id. More...
const char * | getObjName (void)
Get component name. More...
void | print (void)
Print current object address,page id,component id, component name,pop event function address,push event function address.

Additional Inherited Members

- Static Public Member Functions inherited from NexTouch
static uint8_t | mainEventLoop (NexTouch **list)
Watting for Nextion's touch event. More...
static void | sendCommand (const char *cmd)
Send command to Nextion. More...
static bool | recvRetCommandFinished (uint32_t timeout=100)
Command is executed successfully. More...
static uint16_t | recvRetString (char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data. More...
static bool | recvRetNumber (uint32_t *number, uint32_t timeout=500)
Receive uint32_t data. More...

Detailed Description

NexPicture,subclass of NexTouch,provides simple methods to control picture component.

Examples:
CompPicture.ino.

Definition at line 25 of file NexPicture.h.

Member Function Documentation

void NexPicture::attachPop | ( | NexTouchEventCb | pop,
 |  | void * | ptr = NULL
 | ) |  |

Register picture pop callback function.

Parameters
pop | - the pointer to picture pop callback function.
ptr | - the parameter to be transmitted to picture pop callback function.
Examples:
CompPicture.ino.

Definition at line 72 of file NexPicture.cpp.

bool NexPicture::getPic ( uint32_t * number )

Get picture's number.

Parameters
number - an output parameter to save picture number.
Return values
true | - success.
false | - failed.
Examples:
CompPicture.ino.

Definition at line 35 of file NexPicture.cpp.

bool NexPicture::setPic ( uint32_t number )

Set picture's number.

Parameters
number -the picture number.
Return values
true | - success.
false | - failed.
Examples:
CompPicture.ino.

Definition at line 52 of file NexPicture.cpp.

The documentation for this class was generated from the following files:
  • NexPicture.h
  • NexPicture.cpp


API: NexPointer Class Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | List of all members
NexPointer Class Reference

NexPointer,subclass of NexTouch,provides simple methods to control pointer component. More...

#include <NexPointer.h>

Inheritance diagram for NexPointer:
NexTouch

Public Member Functions

NexPointer (NexPid pid, NexCid cid, char *name)
Constructor,inherited NexTouch's constructor function.
bool | getValue (uint32_t *number)
Get the value of pointer. More...
bool | setValue (uint32_t number)
Set the value of pointer. More...
- Public Member Functions inherited from 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. More...
NexPid | getPid (void)
Get page id. More...
NexCid | getCid (void)
Get component id. More...
const char * | getObjName (void)
Get component name. More...
void | print (void)
Print current object address,page id,component id, component name,pop event function address,push event function address.

Additional Inherited Members

- Static Public Member Functions inherited from NexTouch
static uint8_t | mainEventLoop (NexTouch **list)
Watting for Nextion's touch event. More...
static void | sendCommand (const char *cmd)
Send command to Nextion. More...
static bool | recvRetCommandFinished (uint32_t timeout=100)
Command is executed successfully. More...
static uint16_t | recvRetString (char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data. More...
static bool | recvRetNumber (uint32_t *number, uint32_t timeout=500)
Receive uint32_t data. More...

Detailed Description

NexPointer,subclass of NexTouch,provides simple methods to control pointer component.

Examples:
CompPointer.ino.

Definition at line 10 of file NexPointer.h.

Member Function Documentation

bool NexPointer::getValue ( uint32_t * number )

Get the value of pointer.

Parameters
number - an output parameter to save pointer's value.
Return values
true | - success.
false | - failed.
Examples:
CompPointer.ino.

Definition at line 20 of file NexPointer.cpp.

bool NexPointer::setValue ( uint32_t number )

Set the value of pointer.

Parameters
number - the value of pointer.
Return values
true | - success.
false | - failed.
Examples:
CompPointer.ino.

Definition at line 37 of file NexPointer.cpp.

The documentation for this class was generated from the following files:
  • NexPointer.h
  • NexPointer.cpp


API: NexProgressBar Class Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | List of all members
NexProgressBar Class Reference

NexProgressBar,subclass of NexTouch,provides simple methods to control progress bar component. More...

#include <NexProgressBar.h>

Inheritance diagram for NexProgressBar:
NexTouch

Public Member Functions

NexProgressBar (NexPid pid, NexCid cid, char *name)
Constructor,inherited NexTouch's constructor function.
bool | getValue (uint32_t *number)
Get the value of progress bar. More...
bool | setValue (uint32_t number)
Set the value of progress bar. More...
- Public Member Functions inherited from 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. More...
NexPid | getPid (void)
Get page id. More...
NexCid | getCid (void)
Get component id. More...
const char * | getObjName (void)
Get component name. More...
void | print (void)
Print current object address,page id,component id, component name,pop event function address,push event function address.

Additional Inherited Members

- Static Public Member Functions inherited from NexTouch
static uint8_t | mainEventLoop (NexTouch **list)
Watting for Nextion's touch event. More...
static void | sendCommand (const char *cmd)
Send command to Nextion. More...
static bool | recvRetCommandFinished (uint32_t timeout=100)
Command is executed successfully. More...
static uint16_t | recvRetString (char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data. More...
static bool | recvRetNumber (uint32_t *number, uint32_t timeout=500)
Receive uint32_t data. More...

Detailed Description

NexProgressBar,subclass of NexTouch,provides simple methods to control progress bar component.

Examples:
CompProgressBar.ino.

Definition at line 25 of file NexProgressBar.h.

Member Function Documentation

bool NexProgressBar::getValue ( uint32_t * number )

Get the value of progress bar.

Parameters
number - an output parameter to save the value of porgress bar.
Return values
true | - success.
false | - failed.
Examples:
CompProgressBar.ino.

Definition at line 35 of file NexProgressBar.cpp.

bool NexProgressBar::setValue ( uint32_t number )

Set the value of progress bar.

Parameters
number - the value of progress bar.
Return values
true | - success.
false | - failed.
Examples:
CompProgressBar.ino.

Definition at line 52 of file NexProgressBar.cpp.

The documentation for this class was generated from the following files:
  • NexProgressBar.h
  • NexProgressBar.cpp


API: NexSlice Class Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | List of all members
NexSlice Class Reference

NexSlice,subclass of NexTouch,provides simple methods to control slice component. More...

#include <NexSlice.h>

Inheritance diagram for NexSlice:
NexTouch

Public Member Functions

NexSlice (NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
void | attachPop (NexTouchEventCb pop, void *ptr=NULL)
Register slice pop callback function. More...
void | detachPop (void)
Unload slice pop callback function.
- Public Member Functions inherited from 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. More...
NexPid | getPid (void)
Get page id. More...
NexCid | getCid (void)
Get component id. More...
const char * | getObjName (void)
Get component name. More...
void | print (void)
Print current object address,page id,component id, component name,pop event function address,push event function address.

Additional Inherited Members

- Static Public Member Functions inherited from NexTouch
static uint8_t | mainEventLoop (NexTouch **list)
Watting for Nextion's touch event. More...
static void | sendCommand (const char *cmd)
Send command to Nextion. More...
static bool | recvRetCommandFinished (uint32_t timeout=100)
Command is executed successfully. More...
static uint16_t | recvRetString (char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data. More...
static bool | recvRetNumber (uint32_t *number, uint32_t timeout=500)
Receive uint32_t data. More...

Detailed Description

NexSlice,subclass of NexTouch,provides simple methods to control slice component.

Examples:
CompSlice.ino.

Definition at line 25 of file NexSlice.h.

Member Function Documentation

void NexSlice::attachPop | ( | NexTouchEventCb | pop,
 |  | void * | ptr = NULL
 | ) |  |

Register slice pop callback function.

Parameters
pop | - the pointer to slice pop callback function.
ptr | - the parameter to be transmitted to slice pop callback function.
Examples:
CompSlice.ino.

Definition at line 72 of file NexSlice.cpp.

The documentation for this class was generated from the following files:
  • NexSlice.h
  • NexSlice.cpp


API: NexText Class Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | List of all members
NexText Class Reference

NexText,subclass of NexTouch,provides simple methods to control text component. More...

#include <NexText.h>

Inheritance diagram for NexText:
NexTouch

Public Member Functions

NexText (NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
void | attachPop (NexTouchEventCb pop, void *ptr=NULL)
Register text pop callback function. More...
void | detachPop (void)
Unload text pop callback function.
uint16_t | getText (char *buffer, uint16_t len)
Get the value of text. More...
bool | setText (const char *buffer)
Set the value of text. More...
- Public Member Functions inherited from 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. More...
NexPid | getPid (void)
Get page id. More...
NexCid | getCid (void)
Get component id. More...
const char * | getObjName (void)
Get component name. More...
void | print (void)
Print current object address,page id,component id, component name,pop event function address,push event function address.

Additional Inherited Members

- Static Public Member Functions inherited from NexTouch
static uint8_t | mainEventLoop (NexTouch **list)
Watting for Nextion's touch event. More...
static void | sendCommand (const char *cmd)
Send command to Nextion. More...
static bool | recvRetCommandFinished (uint32_t timeout=100)
Command is executed successfully. More...
static uint16_t | recvRetString (char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data. More...
static bool | recvRetNumber (uint32_t *number, uint32_t timeout=500)
Receive uint32_t data. More...

Detailed Description

NexText,subclass of NexTouch,provides simple methods to control text component.

Examples:
CompText.ino.

Definition at line 25 of file NexText.h.

Member Function Documentation

void NexText::attachPop | ( | NexTouchEventCb | pop,
 |  | void * | ptr = NULL
 | ) |  |

Register text pop callback function.

Parameters
pop | - the pointer to text pop callback function.
ptr | - the parameter to be transmitted to text pop callback function.

Definition at line 70 of file NexText.cpp.

uint16_t NexText::getText | ( | char * | buffer,
 |  | uint16_t | len
 | ) |  |

Get the value of text.

Parameters
buffer | - text value buffer.
len | - the length of text value buffer.
Returns
the the length of text value buffer.
Examples:
CompText.ino.

Definition at line 35 of file NexText.cpp.

bool NexText::setText ( const char * buffer )

Set the value of text.

Parameters
buffer - text value buffer.
Return values
true | - success.
false | - failed.
Examples:
CompText.ino.

Definition at line 53 of file NexText.cpp.

The documentation for this class was generated from the following files:
  • NexText.h
  • NexText.cpp


API: NexTouch Class Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Public Member Functions | Static Public Member Functions | List of all members
NexTouch Class Reference

Root Class of Nextion Components. More...

#include <NexTouch.h>

Inheritance diagram for NexTouch:
NexButton NexHotspot NexPage NexPicture NexPointer NexProgressBar NexSlice NexText

Public Member Functions

NexTouch (NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL)
Constructor of Nextouch. More...
NexPid | getPid (void)
Get page id. More...
NexCid | getCid (void)
Get component id. More...
const char * | getObjName (void)
Get component name. More...
void | print (void)
Print current object address,page id,component id, component name,pop event function address,push event function address.

Static Public Member Functions

static uint8_t | mainEventLoop (NexTouch **list)
Watting for Nextion's touch event. More...
static void | sendCommand (const char *cmd)
Send command to Nextion. More...
static bool | recvRetCommandFinished (uint32_t timeout=100)
Command is executed successfully. More...
static uint16_t | recvRetString (char *buffer, uint16_t len, uint32_t timeout=500)
Receive string data. More...
static bool | recvRetNumber (uint32_t *number, uint32_t timeout=500)
Receive uint32_t data. More...

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
pid | - page id.
cid | - component id.
name | - component name.
pop | - pop event function pointer.
pop_ptr | - the parameter was transmitted to pop event function pointer.
push | - push event function pointer.
push_ptr | - the parameter was transmitted to push event function pointer.

Definition at line 74 of file NexTouch.cpp.

Member Function Documentation

NexCid NexTouch::getCid ( void )

Get component id.

Returns
the id of component.

Definition at line 102 of file NexTouch.cpp.

const char * NexTouch::getObjName ( void )

Get component name.

Returns
the name of component.

Definition at line 112 of file NexTouch.cpp.

NexPid NexTouch::getPid ( void )

Get page id.

Returns
the id of page.

Definition at line 92 of file NexTouch.cpp.

uint8_t NexTouch::mainEventLoop ( NexTouch ** list )
static

Watting for Nextion's touch event.

Parameters
list - index to Nextion Components list.

Definition at line 26 of file NexTouch.cpp.

bool NexTouch::recvRetCommandFinished ( uint32_t timeout = 100 )
static

Command is executed successfully.

Parameters
timeout - set timeout time.
Return values
true | - success.
false | - failed.

Definition at line 224 of file NexTouch.cpp.

bool NexTouch::recvRetNumber | ( | uint32_t * | number,
 |  | uint32_t | timeout = 500
 | ) |  |
static

Receive uint32_t data.

Parameters
number | - save uint32_t data.
timeout | - set timeout time.
Return values
true | - success.
false | - failed.

Definition at line 356 of file NexTouch.cpp.

uint16_t NexTouch::recvRetString | ( | char * | buffer,
 |  | uint16_t | len,
 |  | uint32_t | timeout = 500
 | ) |  |
static

Receive string data.

Parameters
buffer | - save string data.
len | - string buffer length.
timeout | - set timeout time.
Returns
the length of string buffer.

Definition at line 284 of file NexTouch.cpp.

void NexTouch::sendCommand ( const char * cmd )
static

Send command to Nextion.

Parameters
cmd - the string of command.

Definition at line 261 of file NexTouch.cpp.

The documentation for this class was generated from the following files:
  • NexTouch.h
  • NexTouch.cpp


API: Class Index

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Class Index
N
N
NexHotspot NexPointer NexText
NexPage NexProgressBar NexTouch
NexButton NexPicture NexSlice
N
Generated on Thu Jul 16 2015 10:59:03 for API by doxygen 1.8.7


API: Class Hierarchy

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
[detail level 12]
▼C NexTouch | Root Class of Nextion Components
C NexButton | NexButton,subclass of NexTouch,provides simple methods to control button component
C NexHotspot | NexHotspot,subclass of NexTouch,provides simple methods to control hotspot component
C NexPage | NexPage,subclass of NexTouch,provides simple methods to control page component
C NexPicture | NexPicture,subclass of NexTouch,provides simple methods to control picture component
C NexPointer | NexPointer,subclass of NexTouch,provides simple methods to control pointer component
C NexProgressBar | NexProgressBar,subclass of NexTouch,provides simple methods to control progress bar component
C NexSlice | NexSlice,subclass of NexTouch,provides simple methods to control slice component
C NexText | NexText,subclass of NexTouch,provides simple methods to control text component


API: Class Members

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • a
  • d
  • g
  • m
  • n
  • p
  • r
  • s
Here is a list of all documented class members with links to the class documentation for each member:

- a -

  • attachPop() : NexButton , NexHotspot , NexPage , NexPicture , NexSlice , NexText
  • attachPush() : NexHotspot

- d -

  • detachPop() : NexButton , NexHotspot , NexPage , NexPicture , NexSlice , NexText
  • detachPush() : NexHotspot

- g -

  • getCid() : NexTouch
  • getObjName() : NexTouch
  • getPic() : NexPicture
  • getPid() : NexTouch
  • getText() : NexButton , NexText
  • getValue() : NexPointer , NexProgressBar

- m -

  • mainEventLoop() : NexTouch

- n -

  • NexButton() : NexButton
  • NexHotspot() : NexHotspot
  • NexPage() : NexPage
  • NexPicture() : NexPicture
  • NexPointer() : NexPointer
  • NexProgressBar() : NexProgressBar
  • NexSlice() : NexSlice
  • NexText() : NexText
  • NexTouch() : NexTouch

- p -

  • print() : NexTouch

- r -

  • recvRetCommandFinished() : NexTouch
  • recvRetNumber() : NexTouch
  • recvRetString() : NexTouch

- s -

  • sendCommand() : NexTouch
  • setPic() : NexPicture
  • setText() : NexButton , NexText
  • setValue() : NexPointer , NexProgressBar
  • show() : NexPage


API: Class Members - Functions

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • a
  • d
  • g
  • m
  • n
  • p
  • r
  • s

- a -

  • attachPop() : NexButton , NexHotspot , NexPage , NexPicture , NexSlice , NexText
  • attachPush() : NexHotspot

- d -

  • detachPop() : NexButton , NexHotspot , NexPage , NexPicture , NexSlice , NexText
  • detachPush() : NexHotspot

- g -

  • getCid() : NexTouch
  • getObjName() : NexTouch
  • getPic() : NexPicture
  • getPid() : NexTouch
  • getText() : NexButton , NexText
  • getValue() : NexPointer , NexProgressBar

- m -

  • mainEventLoop() : NexTouch

- n -

  • NexButton() : NexButton
  • NexHotspot() : NexHotspot
  • NexPage() : NexPage
  • NexPicture() : NexPicture
  • NexPointer() : NexPointer
  • NexProgressBar() : NexProgressBar
  • NexSlice() : NexSlice
  • NexText() : NexText
  • NexTouch() : NexTouch

- p -

  • print() : NexTouch

- r -

  • recvRetCommandFinished() : NexTouch
  • recvRetNumber() : NexTouch
  • recvRetString() : NexTouch

- s -

  • sendCommand() : NexTouch
  • setPic() : NexPicture
  • setText() : NexButton , NexText
  • setValue() : NexPointer , NexProgressBar
  • show() : NexPage


API: File List

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
File List
Here is a list of all documented files with brief descriptions:
[detail level 123]
▼ examples |
▼ CompButton |
CompButton.ino |
▼ CompHotspot |
CompHotspot.ino |
▼ CompPage |
CompPage.ino |
▼ CompPicture |
CompPicture.ino |
▼ CompPointer |
CompPointer.ino |
▼ CompProgressBar |
CompProgressBar.ino |
▼ CompSlice |
CompSlice.ino |
▼ CompText |
CompText.ino |
NexButton.cpp | API of NexButton
NexButton.h | API of NexButton
NexHotspot.cpp | API of NexHotspot
NexHotspot.h | API of NexHotspot
NexPage.cpp | API of NexPage
NexPage.h | API of NexPage
NexPicture.cpp | API of NexPicture
NexPicture.h | API of NexPicture
NexPointer.cpp |
NexPointer.h |
NexProgressBar.cpp | API of NexProgressBar
NexProgressBar.h | API of NexProgressBar
NexSlice.cpp | API of NexSlice
NexSlice.h | API of NexSlice
NexText.cpp | API of NexText
NexText.h | API of NexText
NexTouch.cpp | API of Nextion
NexTouch.h | API of Nextion


API: examples Directory Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • examples
examples Directory Reference

Directories

directory | CompButton
directory | CompHotspot
directory | CompPage
directory | CompPicture
directory | CompPointer
directory | CompProgressBar
directory | CompSlice
directory | CompText


API: examples/CompButton Directory Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • examples
  • CompButton
CompButton Directory Reference

Files

file CompButton.ino [code]


API: examples/CompButton/CompButton.ino Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
  • examples
  • CompButton
CompButton.ino
1
16 #include "NexButton.h"
17
18 NexButton b0 = NexButton(0, 1, "b0");
19 char buffer[100] = {0};
20
21 NexTouch *nexListenList[] =
22 {
23 &b0,
24 NULL
25 };
26
27 void b0PopCallback(void *ptr)
28 {
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 }
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
NexButton.h
API of NexButton.
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: examples/CompHotspot Directory Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • examples
  • CompHotspot
CompHotspot Directory Reference

Files

file CompHotspot.ino [code]


API: examples/CompHotspot/CompHotspot.ino Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
  • examples
  • CompHotspot
CompHotspot.ino
1
16 #include "NexHotspot.h"
17
18 NexHotspot hot0 = NexHotspot(0, 1, "hot0");
19 NexHotspot hot1 = NexHotspot(0, 2, "hot1");
20
21 NexTouch *nexListenList[] =
22 {
23 &hot0,
24 &hot1,
25 NULL
26 };
27
28 void hot0PushCallback(void *ptr)
29 {
30 dbSerial.println("hot0PushCallback");
31 dbSerial.print("ptr=");
32 dbSerial.println((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);
40 }
41
42 void hot0PopCallback(void *ptr)
43 {
44 dbSerial.println("hot0PopCallback");
45 dbSerial.print("ptr=");
46 dbSerial.println((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);
54 }
55
56 void setup(void)
57 {
58 dbSerial.begin(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");
65 }
66
67 void loop(void)
68 {
69 dbSerial.println("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
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
NexHotspot::attachPush
void attachPush(NexTouchEventCb push, void *ptr=NULL)
Register hotspot push callback function.
Definition: NexHotspot.cpp:35
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: examples/CompPage Directory Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • examples
  • CompPage
CompPage Directory Reference

Files

file CompPage.ino [code]


API: examples/CompPage/CompPage.ino Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
  • examples
  • CompPage
CompPage.ino
1
16 #include "NexPage.h"
17
18 NexPage page0 = NexPage(0, 0, "page0");
19 NexPage page1 = NexPage(1, 0, "page1");
20 NexPage page2 = NexPage(2, 0, "page2");
21 NexPage page3 = NexPage(3, 0, "page3");
22
23 NexTouch *nexListenList[] =
24 {
25 &page0,
26 &page1,
27 &page2,
28 &page3,
29 NULL
30 };
31
32 void page0PopCallback(void *ptr)
33 {
34 dbSerial.println("page0PopCallback");
35 page1.show();
36 }
37
38 void page1PopCallback(void *ptr)
39 {
40 dbSerial.println("page1PopCallback");
41 page2.show();
42 }
43
44 void page2PopCallback(void *ptr)
45 {
46 dbSerial.println("page2PopCallback");
47 page3.show();
48 }
49
50 void page3PopCallback(void *ptr)
51 {
52 dbSerial.println("page3PopCallback");
53 page0.show();
54 }
55
56 void setup(void)
57 {
58 dbSerial.begin(9600);
59 nexInit();
60 dbSerial.println("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");
68 }
69
70 void loop(void)
71 {
72 dbSerial.println("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
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: examples/CompPicture Directory Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • examples
  • CompPicture
CompPicture Directory Reference

Files

file CompPicture.ino [code]


API: examples/CompPicture/CompPicture.ino Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
  • examples
  • CompPicture
CompPicture.ino
1
16 #include "NexPicture.h"
17
18 NexPicture p0 = NexPicture(0, 1, "p0");
19
20 NexTouch *nexListenList[] =
21 {
22 &p0,
23 NULL
24 };
25
26 void p0PopCallback(void *ptr)
27 {
28 uint32_t number = 0;
29 dbSerial.println("p0PopCallback");
30
31 p0.getPic(&number);
32
33 if (number == 1)
34 {
35 number = 2;
36 }
37 else
38 {
39 number = 1;
40 }
41
42 p0.setPic(number);
43 }
44
45
46 void setup(void)
47 {
48 dbSerial.begin(9600);
49 nexInit();
50 p0.attachPop(p0PopCallback);
51 dbSerial.println("setup done");
52 }
53
54 void loop(void)
55 {
56 dbSerial.println("nexLoop");
57 nexLoop(nexListenList);
58 }
59
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:423
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
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
NexPicture.h
API of NexPicture.
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: examples/CompPointer Directory Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • examples
  • CompPointer
CompPointer Directory Reference

Files

file CompPointer.ino [code]


API: examples/CompPointer/CompPointer.ino Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
  • examples
  • CompPointer
CompPointer.ino
1
16 #include "NexPointer.h"
17 #include "NexButton.h"
18
19 NexPointer pointer = NexPointer(0, 1, "pointer");
20 NexButton btn_up = NexButton(0, 2, "btn_up");
21 NexButton btn_down = NexButton(0, 3, "btn_down");
22
23 NexTouch *nexListenList[] =
24 {
25 &btn_up,
26 &btn_down,
27 NULL
28 };
29
30 void buttonUpPopCallback(void *ptr)
31 {
32 uint32_t number = 0;
33 dbSerial.println("buttonUpPopCallback");
34
35 pointer.getValue(&number);
36
37 number += 5;
38 if (number >= 360)
39 {
40 number = 0;
41 }
42
43 pointer.setValue(number);
44 }
45 void buttonDownPopCallback(void *ptr)
46 {
47 uint32_t number = 0;
48 dbSerial.println("buttonDownPopCallback");
49
50 pointer.getValue(&number);
51
52 if (number >= 5)
53 {
54 number -= 5;
55 }
56
57 pointer.setValue(number);
58 }
59
60
61
62 void setup(void)
63 {
64 dbSerial.begin(9600);
65 nexInit();
66 btn_up.attachPop(buttonUpPopCallback);
67 btn_down.attachPop(buttonDownPopCallback);
68 dbSerial.println("setup done");
69 }
70
71 void loop(void)
72 {
73 dbSerial.println("nexLoop");
74 nexLoop(nexListenList);
75 }
76
nexInit
bool nexInit(void)
Init Nextion's baudrate,page id.
Definition: NexTouch.cpp:423
NexButton.h
API of NexButton.
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: examples/CompProgressBar Directory Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • examples
  • CompProgressBar
CompProgressBar Directory Reference

Files

file CompProgressBar.ino [code]


API: examples/CompProgressBar/CompProgressBar.ino Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
  • examples
  • CompProgressBar
CompProgressBar.ino
1
16 #include "NexProgressBar.h"
17 #include "NexButton.h"
18
19 NexProgressBar j0 = NexProgressBar(0, 3, "j0");
20 NexButton btn_up = NexButton(0, 1, "btn_up");
21 NexButton btn_down = NexButton(0, 2, "btn_down");
22
23 NexTouch *nexListenList[] =
24 {
25 &btn_up,
26 &btn_down,
27 NULL
28 };
29
30 void buttonUpPopCallback(void *ptr)
31 {
32 uint32_t number = 0;
33 dbSerial.println("buttonUpPopCallback");
34
35 j0.getValue(&number);
36
37 number += 5;
38 if (number >= 100)
39 {
40 number = 100;
41 }
42
43 j0.setValue(number);
44 }
45 void buttonDownPopCallback(void *ptr)
46 {
47 uint32_t number = 0;
48 dbSerial.println("buttonDownPopCallback");
49
50 j0.getValue(&number);
51
52 if (number >= 5)
53 {
54 number -= 5;
55 }
56
57 j0.setValue(number);
58 }
59
60
61
62 void setup(void)
63 {
64 uint32_t brightness = 0;
65
66 dbSerial.begin(9600);
67 nexInit();
68 btn_up.attachPop(buttonUpPopCallback);
69 btn_down.attachPop(buttonDownPopCallback);
70 dbSerial.println("setup done");
71 }
72
73 void loop(void)
74 {
75 dbSerial.println("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
NexButton.h
API of NexButton.
nexLoop
bool nexLoop(NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event.
Definition: NexTouch.cpp:440
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
NexProgressBar
NexProgressBar,subclass of NexTouch,provides simple methods to control progress bar component...
Definition: NexProgressBar.h:25
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: examples/CompSlice Directory Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • examples
  • CompSlice
CompSlice Directory Reference

Files

file CompSlice.ino [code]


API: examples/CompSlice/CompSlice.ino Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
  • examples
  • CompSlice
CompSlice.ino
1
16 #include "NexSlice.h"
17
18 NexSlice q0 = NexSlice(0, 1, "q0");
19
20 NexTouch *nexListenList[] =
21 {
22 &q0,
23 NULL
24 };
25
26 void q0PopCallback(void *ptr)
27 {
28 uint32_t number = 0;
29 dbSerial.println("q0PopCallback");
30
31 q0.getPic(&number);
32
33 number += 1;
34 number %= 2;
35
36 q0.setPic(number);
37 }
38
39
40 void setup(void)
41 {
42 dbSerial.begin(9600);
43 nexInit();
44 q0.attachPop(q0PopCallback);
45 dbSerial.println("setup done");
46 }
47
48 void loop(void)
49 {
50 dbSerial.println("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
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: examples/CompText Directory Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • examples
  • CompText
CompText Directory Reference

Files

file CompText.ino [code]


API: examples/CompText/CompText.ino Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
  • examples
  • CompText
CompText.ino
1
16 #include "NexButton.h"
17 #include "NexText.h"
18
19 void t0PopCallback(void *ptr);
20 void b0PopCallback(void *ptr);
21 void b1PopCallback(void *ptr);
22
23 NexText t0 = NexText(0, 1, "t0", t0PopCallback);
24 NexButton b0 = NexButton(0, 2, "b0", b0PopCallback);
25 NexButton b1 = NexButton(0, 3, "b1", b1PopCallback);
26
27 char buffer[100] = {0};
28
29 NexTouch *nexListenList[] =
30 {
31 &t0,
32 &b0,
33 &b1,
34 NULL
35 };
36
37 void t0PopCallback(void *ptr)
38 {
39 dbSerial.println("t0PopCallback");
40 t0.setText("50");
41 }
42
43 void b0PopCallback(void *ptr)
44 {
45 uint16_t len;
46 uint16_t number;
47
48 dbSerial.println("b0PopCallback");
49
50 memset(buffer, 0, sizeof(buffer));
51 t0.getText(buffer, sizeof(buffer));
52
53 number = atoi(buffer);
54 number += 1;
55
56 memset(buffer, 0, sizeof(buffer));
57 itoa(number, buffer, 10);
58
59 t0.setText(buffer);
60 }
61
62 void b1PopCallback(void *ptr)
63 {
64 uint16_t len;
65 uint16_t number;
66
67 dbSerial.println("b1PopCallback");
68
69 memset(buffer, 0, sizeof(buffer));
70 t0.getText(buffer, sizeof(buffer));
71
72 number = atoi(buffer);
73 number -= 1;
74
75 memset(buffer, 0, sizeof(buffer));
76 itoa(number, buffer, 10);
77
78 t0.setText(buffer);
79 }
80
81 void setup(void)
82 {
83 dbSerial.begin(9600);
84 nexInit();
85 dbSerial.println("setup done");
86 }
87
88 void loop(void)
89 {
90 dbSerial.println("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
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
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
NexText
NexText,subclass of NexTouch,provides simple methods to control text component.
Definition: NexText.h:25
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexButton.cpp File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexButton.cpp File Reference

API of NexButton. More...

#include "NexButton.h"

Go to the source code of this file.

Detailed Description

API of NexButton.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexButton.cpp.


API: NexButton.h File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
Classes
NexButton.h File Reference

API of NexButton. More...

#include "NexTouch.h"

Go to the source code of this file.

Classes

class NexButton
NexButton,subclass of NexTouch,provides simple methods to control button component. More...

Detailed Description

API of NexButton.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexButton.h.


API: NexHotspot.cpp File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexHotspot.cpp File Reference

API of NexHotspot. More...

#include "NexHotspot.h"

Go to the source code of this file.

Detailed Description

API of NexHotspot.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexHotspot.cpp.


API: NexHotspot.h File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
Classes
NexHotspot.h File Reference

API of NexHotspot. More...

#include "NexTouch.h"

Go to the source code of this file.

Classes

class NexHotspot
NexHotspot,subclass of NexTouch,provides simple methods to control hotspot component. More...

Detailed Description

API of NexHotspot.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexHotspot.h.


API: NexPage.cpp File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexPage.cpp File Reference

API of NexPage. More...

#include "NexPage.h"

Go to the source code of this file.

Detailed Description

API of NexPage.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexPage.cpp.


API: NexPage.h File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
Classes
NexPage.h File Reference

API of NexPage. More...

#include "NexTouch.h"

Go to the source code of this file.

Classes

class NexPage
NexPage,subclass of NexTouch,provides simple methods to control page component. More...

Detailed Description

API of NexPage.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexPage.h.


API: NexPicture.cpp File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexPicture.cpp File Reference

API of NexPicture. More...

#include "NexPicture.h"

Go to the source code of this file.

Detailed Description

API of NexPicture.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexPicture.cpp.


API: NexPicture.h File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
Classes
NexPicture.h File Reference

API of NexPicture. More...

#include "NexTouch.h"

Go to the source code of this file.

Classes

class NexPicture
NexPicture,subclass of NexTouch,provides simple methods to control picture component. More...

Detailed Description

API of NexPicture.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexPicture.h.


API: NexPointer.cpp Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexPointer.cpp
1 #include "NexPointer.h"
2
7 NexPointer::NexPointer(NexPid pid, NexCid cid, char *name)
8 :NexTouch(pid, cid, name)
9 {
10 }
11
20 bool NexPointer::getValue(uint32_t *number)
21 {
22 String cmd = String("get ");
23 cmd += getObjName();
24 cmd += ".val";
25 sendCommand(cmd.c_str());
26 return recvRetNumber(number);
27 }
28
37 bool NexPointer::setValue(uint32_t number)
38 {
39 char buf[10] = {0};
40 String cmd;
41
42 utoa(number, buf, 10);
43 cmd += getObjName();
44 cmd += ".val=";
45 cmd += buf;
46
47 sendCommand(cmd.c_str());
48 return recvRetCommandFinished();
49 }
50
NexPointer::getValue
bool getValue(uint32_t *number)
Get the value of pointer.
Definition: NexPointer.cpp:20
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::recvRetNumber
static bool recvRetNumber(uint32_t *number, uint32_t timeout=500)
Receive uint32_t data.
Definition: NexTouch.cpp:356
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexPointer.h Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexPointer.h
1 #ifndef __NEXPOINTER_H__
2 #define __NEXPOINTER_H__
3 #ifdef __cplusplus
4 #include "NexTouch.h"
5
10 class NexPointer: public NexTouch
11 {
12 public: /* methods */
13 NexPointer(NexPid pid, NexCid cid, char *name);
14
15 bool getValue(uint32_t *number);
16 bool setValue(uint32_t number);
17 };
18
19 #endif /* #ifdef __cplusplus */
20 #endif /* #ifndef __NEXPOINTER_H__ */
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
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexProgressBar.cpp File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexProgressBar.cpp File Reference

API of NexProgressBar. More...

#include "NexProgressBar.h"

Go to the source code of this file.

Detailed Description

API of NexProgressBar.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexProgressBar.cpp.


API: NexProgressBar.h File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
Classes
NexProgressBar.h File Reference

API of NexProgressBar. More...

#include "NexTouch.h"

Go to the source code of this file.

Classes

class NexProgressBar
NexProgressBar,subclass of NexTouch,provides simple methods to control progress bar component. More...

Detailed Description

API of NexProgressBar.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexProgressBar.h.


API: NexSlice.cpp File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexSlice.cpp File Reference

API of NexSlice. More...

#include "NexSlice.h"

Go to the source code of this file.

Detailed Description

API of NexSlice.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexSlice.cpp.


API: NexSlice.h File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
Classes
NexSlice.h File Reference

API of NexSlice. More...

#include "NexTouch.h"

Go to the source code of this file.

Classes

class NexSlice
NexSlice,subclass of NexTouch,provides simple methods to control slice component. More...

Detailed Description

API of NexSlice.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexSlice.h.


API: NexText.cpp File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexText.cpp File Reference

API of NexText. More...

#include "NexText.h"

Go to the source code of this file.

Detailed Description

API of NexText.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexText.cpp.


API: NexText.h File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
Classes
NexText.h File Reference

API of NexText. More...

#include "NexTouch.h"

Go to the source code of this file.

Classes

class NexText
NexText,subclass of NexTouch,provides simple methods to control text component. More...

Detailed Description

API of NexText.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexText.h.


API: NexTouch.cpp File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
Functions
NexTouch.cpp File Reference

API of Nextion. More...

#include "NexTouch.h"

Go to the source code of this file.

Functions

bool | nexInit (void)
Init Nextion's baudrate,page id. More...
bool | nexLoop (NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event. More...

Detailed Description

API of Nextion.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexTouch.cpp.

Function Documentation

bool nexInit ( void )

Init Nextion's baudrate,page id.

Return values
true | - success.
false | - failed.
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.

bool nexLoop ( NexTouch ** nexListenList )

Call mainEventLoop,watting for Nextion's touch event.

Parameters
nexListenList - index to Nextion Components list.
Return values
false - failed.
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.


API: NexTouch.h File Reference

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
Classes | Functions
NexTouch.h File Reference

API of Nextion. More...

#include <Arduino.h>

Go to the source code of this file.

Classes

class NexTouch
Root Class of Nextion Components. More...

Functions

bool | nexInit (void)
Init Nextion's baudrate,page id. More...
bool | nexLoop (NexTouch **nexListenList)
Call mainEventLoop,watting for Nextion's touch event. More...

Detailed Description

API of Nextion.

Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file NexTouch.h.

Function Documentation

bool nexInit ( void )

Init Nextion's baudrate,page id.

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

Definition at line 423 of file NexTouch.cpp.

bool nexLoop ( NexTouch ** nexListenList )

Call mainEventLoop,watting for Nextion's touch event.

Parameters
nexListenList - index to Nextion Components list.
Return values
false - failed.

Definition at line 440 of file NexTouch.cpp.


API: File Members

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
  • All
  • Functions
Here is a list of all documented file members with links to the documentation:
  • nexInit() : NexTouch.cpp , NexTouch.h
  • nexLoop() : NexTouch.cpp , NexTouch.h


API: File Members

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
  • All
  • Functions
  • nexInit() : NexTouch.cpp , NexTouch.h
  • nexLoop() : NexTouch.cpp , NexTouch.h


API: Examples

API
  • Related Pages
  • Classes
  • Files
  • Examples
Examples
Here is a list of all examples:
  • CompButton.ino
  • CompHotspot.ino
  • CompPage.ino
  • CompPicture.ino
  • CompPointer.ino
  • CompProgressBar.ino
  • CompSlice.ino
  • CompText.ino


API: CompButton.ino

API
  • Related Pages
  • Classes
  • Files
  • Examples
CompButton.ino
Show how to use API of class NexButton.
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
#include "NexButton.h"
NexButton b0 = NexButton(0, 1, "b0");
char buffer[100] = {0};
NexTouch *nexListenList[] =
{
&b0,
NULL
};
void b0PopCallback(void *ptr)
{
uint16_t len;
uint16_t number;
NexButton *btn = (NexButton *)ptr;
dbSerial.println("b0PopCallback");
dbSerial.print("ptr=");
dbSerial.println((uint32_t)ptr);
memset(buffer, 0, sizeof(buffer));
btn->getText(buffer, sizeof(buffer));
number = atoi(buffer);
number += 1;
memset(buffer, 0, sizeof(buffer));
itoa(number, buffer, 10);
btn->setText(buffer);
}
void setup(void)
{
dbSerial.begin(9600);
nexInit();
b0.attachPop(b0PopCallback, &b0);
dbSerial.println("setup done");
}
void loop(void)
{
dbSerial.println("nexLoop");
nexLoop(nexListenList);
}
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: CompHotspot.ino

API
  • Related Pages
  • Classes
  • Files
  • Examples
CompHotspot.ino
Show how to use API of class NexHotspot.
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
#include "NexHotspot.h"
NexHotspot hot0 = NexHotspot(0, 1, "hot0");
NexHotspot hot1 = NexHotspot(0, 2, "hot1");
NexTouch *nexListenList[] =
{
&hot0,
&hot1,
NULL
};
void hot0PushCallback(void *ptr)
{
dbSerial.println("hot0PushCallback");
dbSerial.print("ptr=");
dbSerial.println((uint32_t)ptr);
}
void hot1PushCallback(void *ptr)
{
dbSerial.println("hot1PushCallback");
dbSerial.print("ptr=");
dbSerial.println((uint32_t)ptr);
}
void hot0PopCallback(void *ptr)
{
dbSerial.println("hot0PopCallback");
dbSerial.print("ptr=");
dbSerial.println((uint32_t)ptr);
}
void hot1PopCallback(void *ptr)
{
dbSerial.println("hot1PopCallback");
dbSerial.print("ptr=");
dbSerial.println((uint32_t)ptr);
}
void setup(void)
{
dbSerial.begin(9600);
nexInit();
hot0.attachPush(hot0PushCallback, &hot0);
hot0.attachPop(hot0PopCallback, &hot0);
hot1.attachPush(hot1PushCallback, &hot1);
hot1.attachPop(hot1PopCallback, &hot1);
dbSerial.println("setup done");
}
void loop(void)
{
dbSerial.println("nexLoop");
nexLoop(nexListenList);
}
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: CompPage.ino

API
  • Related Pages
  • Classes
  • Files
  • Examples
CompPage.ino
Show how to use API of class NexPage.
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
#include "NexPage.h"
NexPage page0 = NexPage(0, 0, "page0");
NexPage page1 = NexPage(1, 0, "page1");
NexPage page2 = NexPage(2, 0, "page2");
NexPage page3 = NexPage(3, 0, "page3");
NexTouch *nexListenList[] =
{
&page0,
&page1,
&page2,
&page3,
NULL
};
void page0PopCallback(void *ptr)
{
dbSerial.println("page0PopCallback");
page1.show();
}
void page1PopCallback(void *ptr)
{
dbSerial.println("page1PopCallback");
page2.show();
}
void page2PopCallback(void *ptr)
{
dbSerial.println("page2PopCallback");
page3.show();
}
void page3PopCallback(void *ptr)
{
dbSerial.println("page3PopCallback");
page0.show();
}
void setup(void)
{
dbSerial.begin(9600);
nexInit();
dbSerial.println("setup begin");
page0.attachPop(page0PopCallback);
page1.attachPop(page1PopCallback);
page2.attachPop(page2PopCallback);
page3.attachPop(page3PopCallback);
dbSerial.println("setup end");
}
void loop(void)
{
dbSerial.println("nexLoop");
nexLoop(nexListenList);
}
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: CompPicture.ino

API
  • Related Pages
  • Classes
  • Files
  • Examples
CompPicture.ino
Show how to use API of class NexPicture.
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
#include "NexPicture.h"
NexPicture p0 = NexPicture(0, 1, "p0");
NexTouch *nexListenList[] =
{
&p0,
NULL
};
void p0PopCallback(void *ptr)
{
uint32_t number = 0;
dbSerial.println("p0PopCallback");
p0.getPic(&number);
if (number == 1)
{
number = 2;
}
else
{
number = 1;
}
p0.setPic(number);
}
void setup(void)
{
dbSerial.begin(9600);
nexInit();
p0.attachPop(p0PopCallback);
dbSerial.println("setup done");
}
void loop(void)
{
dbSerial.println("nexLoop");
nexLoop(nexListenList);
}
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: CompPointer.ino

API
  • Related Pages
  • Classes
  • Files
  • Examples
CompPointer.ino
Show how to use API of class NexPointer.
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
#include "NexPointer.h"
#include "NexButton.h"
NexPointer pointer = NexPointer(0, 1, "pointer");
NexButton btn_up = NexButton(0, 2, "btn_up");
NexButton btn_down = NexButton(0, 3, "btn_down");
NexTouch *nexListenList[] =
{
&btn_up,
&btn_down,
NULL
};
void buttonUpPopCallback(void *ptr)
{
uint32_t number = 0;
dbSerial.println("buttonUpPopCallback");
pointer.getValue(&number);
number += 5;
if (number >= 360)
{
number = 0;
}
pointer.setValue(number);
}
void buttonDownPopCallback(void *ptr)
{
uint32_t number = 0;
dbSerial.println("buttonDownPopCallback");
pointer.getValue(&number);
if (number >= 5)
{
number -= 5;
}
pointer.setValue(number);
}
void setup(void)
{
dbSerial.begin(9600);
nexInit();
btn_up.attachPop(buttonUpPopCallback);
btn_down.attachPop(buttonDownPopCallback);
dbSerial.println("setup done");
}
void loop(void)
{
dbSerial.println("nexLoop");
nexLoop(nexListenList);
}
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: CompProgressBar.ino

API
  • Related Pages
  • Classes
  • Files
  • Examples
CompProgressBar.ino
Show how to use API of class NexProgressBar.
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
#include "NexProgressBar.h"
#include "NexButton.h"
NexProgressBar j0 = NexProgressBar(0, 3, "j0");
NexButton btn_up = NexButton(0, 1, "btn_up");
NexButton btn_down = NexButton(0, 2, "btn_down");
NexTouch *nexListenList[] =
{
&btn_up,
&btn_down,
NULL
};
void buttonUpPopCallback(void *ptr)
{
uint32_t number = 0;
dbSerial.println("buttonUpPopCallback");
j0.getValue(&number);
number += 5;
if (number >= 100)
{
number = 100;
}
j0.setValue(number);
}
void buttonDownPopCallback(void *ptr)
{
uint32_t number = 0;
dbSerial.println("buttonDownPopCallback");
j0.getValue(&number);
if (number >= 5)
{
number -= 5;
}
j0.setValue(number);
}
void setup(void)
{
uint32_t brightness = 0;
dbSerial.begin(9600);
nexInit();
btn_up.attachPop(buttonUpPopCallback);
btn_down.attachPop(buttonDownPopCallback);
dbSerial.println("setup done");
}
void loop(void)
{
dbSerial.println("nexLoop");
nexLoop(nexListenList);
}
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: CompSlice.ino

API
  • Related Pages
  • Classes
  • Files
  • Examples
CompSlice.ino
Show how to use API of class NexSlice.
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
#include "NexSlice.h"
NexSlice q0 = NexSlice(0, 1, "q0");
NexTouch *nexListenList[] =
{
&q0,
NULL
};
void q0PopCallback(void *ptr)
{
uint32_t number = 0;
dbSerial.println("q0PopCallback");
q0.getPic(&number);
number += 1;
number %= 2;
q0.setPic(number);
}
void setup(void)
{
dbSerial.begin(9600);
nexInit();
q0.attachPop(q0PopCallback);
dbSerial.println("setup done");
}
void loop(void)
{
dbSerial.println("nexLoop");
nexLoop(nexListenList);
}
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: CompText.ino

API
  • Related Pages
  • Classes
  • Files
  • Examples
CompText.ino
Show how to use API of class NexText.
Author
Wu Pengfei (email:pengf.nosp@m.ei.w.nosp@m.u@ite.nosp@m.ad.c.nosp@m.c)
Date
2015/7/10
Copyright
Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
#include "NexButton.h"
#include "NexText.h"
void t0PopCallback(void *ptr);
void b0PopCallback(void *ptr);
void b1PopCallback(void *ptr);
NexText t0 = NexText(0, 1, "t0", t0PopCallback);
NexButton b0 = NexButton(0, 2, "b0", b0PopCallback);
NexButton b1 = NexButton(0, 3, "b1", b1PopCallback);
char buffer[100] = {0};
NexTouch *nexListenList[] =
{
&t0,
&b0,
&b1,
NULL
};
void t0PopCallback(void *ptr)
{
dbSerial.println("t0PopCallback");
t0.setText("50");
}
void b0PopCallback(void *ptr)
{
uint16_t len;
uint16_t number;
dbSerial.println("b0PopCallback");
memset(buffer, 0, sizeof(buffer));
t0.getText(buffer, sizeof(buffer));
number = atoi(buffer);
number += 1;
memset(buffer, 0, sizeof(buffer));
itoa(number, buffer, 10);
t0.setText(buffer);
}
void b1PopCallback(void *ptr)
{
uint16_t len;
uint16_t number;
dbSerial.println("b1PopCallback");
memset(buffer, 0, sizeof(buffer));
t0.getText(buffer, sizeof(buffer));
number = atoi(buffer);
number -= 1;
memset(buffer, 0, sizeof(buffer));
itoa(number, buffer, 10);
t0.setText(buffer);
}
void setup(void)
{
dbSerial.begin(9600);
nexInit();
dbSerial.println("setup done");
}
void loop(void)
{
dbSerial.println("nexLoop");
nexLoop(nexListenList);
}
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexButton.cpp Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexButton.cpp
Go to the documentation of this file.
1
16 #include "NexButton.h"
17
22 NexButton::NexButton(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop, void *pop_ptr)
23 :NexTouch(pid, cid, name, pop, pop_ptr)
24 {
25 }
26
35 uint16_t NexButton::getText(char *buffer, uint16_t len)
36 {
37 String cmd;
38 cmd += "get ";
39 cmd += getObjName();
40 cmd += ".txt";
41 sendCommand(cmd.c_str());
42 return recvRetString(buffer,len);
43 }
44
53 bool NexButton::setText(const char *buffer)
54 {
55 String cmd;
56 cmd += getObjName();
57 cmd += ".txt=\"";
58 cmd += buffer;
59 cmd += "\"";
60 sendCommand(cmd.c_str());
61 return recvRetCommandFinished();
62 }
63
70 void NexButton::attachPop(NexTouchEventCb pop, void *ptr)
71 {
72 NexTouch::attachPop(pop, ptr);
73 }
74
79 void NexButton::detachPop(void)
80 {
81 NexTouch::detachPop();
82 }
83
84
NexButton::NexButton
NexButton(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
Definition: NexButton.cpp:22
NexButton::getText
uint16_t getText(char *buffer, uint16_t len)
Get text value from button component.
Definition: NexButton.cpp:35
NexButton.h
API of NexButton.
NexButton::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register button pop callback function.
Definition: NexButton.cpp:70
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
NexButton::setText
bool setText(const char *buffer)
Set text value of button component.
Definition: NexButton.cpp:53
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexButton.h Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexButton.h
Go to the documentation of this file.
1
16 #ifndef __NEXBUTTON_H__
17 #define __NEXBUTTON_H__
18 #ifdef __cplusplus
19 #include "NexTouch.h"
20
25 class NexButton: public NexTouch
26 {
27 public: /* methods */
28 NexButton(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop = NULL, void *pop_ptr = NULL);
29
30 void attachPop(NexTouchEventCb pop, void *ptr = NULL);
31 void detachPop(void);
32
33 uint16_t getText(char *buffer, uint16_t len);
34 bool setText(const char *buffer);
35 };
36
37 #endif /* #ifdef __cplusplus */
38 #endif /* #ifndef __NEXBUTTON_H__ */
NexButton::NexButton
NexButton(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
Definition: NexButton.cpp:22
NexButton::getText
uint16_t getText(char *buffer, uint16_t len)
Get text value from button component.
Definition: NexButton.cpp:35
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.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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexHotspot.cpp Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexHotspot.cpp
Go to the documentation of this file.
1
16 #include "NexHotspot.h"
17
22 NexHotspot::NexHotspot(NexPid pid, NexCid cid, char *name,
23 NexTouchEventCb pop, void *pop_ptr,
24 NexTouchEventCb push, void *push_ptr)
25 :NexTouch(pid, cid, name, pop, pop_ptr, push, push_ptr)
26 {
27 }
28
35 void NexHotspot::attachPush(NexTouchEventCb push, void *ptr)
36 {
37 NexTouch::attachPush(push, ptr);
38 }
39
44 void NexHotspot::detachPush(void)
45 {
46 NexTouch::detachPush();
47 }
48
55 void NexHotspot::attachPop(NexTouchEventCb pop, void *ptr)
56 {
57 NexTouch::attachPop(pop, ptr);
58 }
59
64 void NexHotspot::detachPop(void)
65 {
66 NexTouch::detachPop();
67 }
NexHotspot::detachPop
void detachPop(void)
Unload hotsopt pop callback function.
Definition: NexHotspot.cpp:64
NexHotspot::detachPush
void detachPush(void)
Unload hotsopt push callback function.
Definition: NexHotspot.cpp:44
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
NexHotspot::attachPush
void attachPush(NexTouchEventCb push, void *ptr=NULL)
Register hotspot push callback function.
Definition: NexHotspot.cpp:35
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexHotspot.h Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexHotspot.h
Go to the documentation of this file.
1
16 #ifndef __NEXHOTSPOT_H__
17 #define __NEXHOTSPOT_H__
18 #ifdef __cplusplus
19 #include "NexTouch.h"
20
25 class NexHotspot: public NexTouch
26 {
27 public: /* methods */
28 NexHotspot(NexPid pid, NexCid cid, char *name,
29 NexTouchEventCb pop = NULL, void *pop_ptr = NULL,
30 NexTouchEventCb push = NULL, void *push_ptr = NULL);
31
32 void attachPush(NexTouchEventCb push, void *ptr = NULL);
33 void detachPush(void);
34 void attachPop(NexTouchEventCb pop, void *ptr = NULL);
35 void detachPop(void);
36
37 };
38
39 #endif /* #ifdef __cplusplus */
40 #endif /* #ifndef __NEXHOTSPOT_H__ */
NexHotspot::detachPop
void detachPop(void)
Unload hotsopt pop callback function.
Definition: NexHotspot.cpp:64
NexHotspot::detachPush
void detachPush(void)
Unload hotsopt push callback function.
Definition: NexHotspot.cpp:44
NexTouch.h
API of Nextion.
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
NexHotspot::attachPush
void attachPush(NexTouchEventCb push, void *ptr=NULL)
Register hotspot push callback function.
Definition: NexHotspot.cpp:35
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexPage.cpp Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexPage.cpp
Go to the documentation of this file.
1
16 #include "NexPage.h"
17
22 NexPage::NexPage(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop, void *pop_ptr)
23 :NexTouch(pid, cid, name, pop, pop_ptr)
24 {
25 }
26
33 bool NexPage::show(void)
34 {
35 uint8_t buffer[4] = {0};
36
37 const char *name = getObjName();
38 if (!name)
39 {
40 return false;
41 }
42
43 String cmd = String("page ");
44 cmd += name;
45 sendCommand(cmd.c_str());
46 return recvRetCommandFinished();
47 }
48
55 void NexPage::attachPop(NexTouchEventCb pop, void *ptr)
56 {
57 NexTouch::attachPop(pop, ptr);
58 }
59
64 void NexPage::detachPop(void)
65 {
66 NexTouch::detachPop();
67 }
NexPage::detachPop
void detachPop(void)
Unload page pop callback function.
Definition: NexPage.cpp:64
NexPage::show
bool show(void)
Change page.
Definition: NexPage.cpp:33
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
NexPage.h
API of NexPage.
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexPage.h Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexPage.h
Go to the documentation of this file.
1
16 #ifndef __NEXPAGE_H__
17 #define __NEXPAGE_H__
18 #ifdef __cplusplus
19 #include "NexTouch.h"
20
25 class NexPage: public NexTouch
26 {
27 public: /* methods */
28 NexPage(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop = NULL, void *pop_ptr = NULL);
29 bool show(void);
30
31 void attachPop(NexTouchEventCb pop, void *ptr = NULL);
32 void detachPop(void);
33
34 };
35
36 #endif /* #ifdef __cplusplus */
37 #endif /* #ifndef __NEXPAGE_H__ */
NexPage::detachPop
void detachPop(void)
Unload page pop callback function.
Definition: NexPage.cpp:64
NexPage::show
bool show(void)
Change page.
Definition: NexPage.cpp:33
NexPage
NexPage,subclass of NexTouch,provides simple methods to control page component.
Definition: NexPage.h:25
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexPicture.cpp Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexPicture.cpp
Go to the documentation of this file.
1
16 #include "NexPicture.h"
17
22 NexPicture::NexPicture(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop, void *pop_ptr)
23 :NexTouch(pid, cid, name, pop, pop_ptr)
24 {
25 }
26
35 bool NexPicture::getPic(uint32_t *number)
36 {
37 String cmd = String("get ");
38 cmd += getObjName();
39 cmd += ".pic";
40 sendCommand(cmd.c_str());
41 return recvRetNumber(number);
42 }
43
52 bool NexPicture::setPic(uint32_t number)
53 {
54 char buf[10] = {0};
55 String cmd;
56
57 utoa(number, buf, 10);
58 cmd += getObjName();
59 cmd += ".pic=";
60 cmd += buf;
61
62 sendCommand(cmd.c_str());
63 return recvRetCommandFinished();
64 }
65
72 void NexPicture::attachPop(NexTouchEventCb pop, void *ptr)
73 {
74 NexTouch::attachPop(pop, ptr);
75 }
76
81 void NexPicture::detachPop(void)
82 {
83 NexTouch::detachPop();
84 }
85
NexPicture::detachPop
void detachPop(void)
Unload picture pop callback function.
Definition: NexPicture.cpp:81
NexPicture::setPic
bool setPic(uint32_t number)
Set picture's number.
Definition: NexPicture.cpp:52
NexPicture::NexPicture
NexPicture(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
Definition: NexPicture.cpp:22
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
NexPicture::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register picture pop callback function.
Definition: NexPicture.cpp:72
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
NexPicture.h
API of NexPicture.
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexPicture.h Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexPicture.h
Go to the documentation of this file.
1
16 #ifndef __NEXPICTURE_H__
17 #define __NEXPICTURE_H__
18 #ifdef __cplusplus
19 #include "NexTouch.h"
20
25 class NexPicture: public NexTouch
26 {
27 public: /* methods */
28 NexPicture(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop = NULL, void *pop_ptr = NULL);
29
30 void attachPop(NexTouchEventCb pop, void *ptr = NULL);
31 void detachPop(void);
32
33 bool getPic(uint32_t *number);
34 bool setPic(uint32_t number);
35 };
36
37 #endif /* #ifdef __cplusplus */
38 #endif /* #ifndef __NEXPICTURE_H__ */
NexPicture::detachPop
void detachPop(void)
Unload picture pop callback function.
Definition: NexPicture.cpp:81
NexPicture::setPic
bool setPic(uint32_t number)
Set picture's number.
Definition: NexPicture.cpp:52
NexPicture::NexPicture
NexPicture(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL)
Constructor,inherited NexTouch's constructor function.
Definition: NexPicture.cpp:22
NexPicture
NexPicture,subclass of NexTouch,provides simple methods to control picture component.
Definition: NexPicture.h:25
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexProgressBar.cpp Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexProgressBar.cpp
Go to the documentation of this file.
1
16 #include "NexProgressBar.h"
17
22 NexProgressBar::NexProgressBar(NexPid pid, NexCid cid, char *name)
23 :NexTouch(pid, cid, name)
24 {
25 }
26
35 bool NexProgressBar::getValue(uint32_t *number)
36 {
37 String cmd = String("get ");
38 cmd += getObjName();
39 cmd += ".val";
40 sendCommand(cmd.c_str());
41 return recvRetNumber(number);
42 }
43
52 bool NexProgressBar::setValue(uint32_t number)
53 {
54 char buf[10] = {0};
55 String cmd;
56
57 utoa(number, buf, 10);
58 cmd += getObjName();
59 cmd += ".val=";
60 cmd += buf;
61
62 sendCommand(cmd.c_str());
63 return recvRetCommandFinished();
64 }
65
NexProgressBar::setValue
bool setValue(uint32_t number)
Set the value of progress bar.
Definition: NexProgressBar.cpp:52
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
NexProgressBar::getValue
bool getValue(uint32_t *number)
Get the value of progress bar.
Definition: NexProgressBar.cpp:35
NexTouch::recvRetNumber
static bool recvRetNumber(uint32_t *number, uint32_t timeout=500)
Receive uint32_t data.
Definition: NexTouch.cpp:356
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexProgressBar.h Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexProgressBar.h
Go to the documentation of this file.
1
16 #ifndef __NEXPROGRESSBAR_H__
17 #define __NEXPROGRESSBAR_H__
18 #ifdef __cplusplus
19 #include "NexTouch.h"
20
25 class NexProgressBar: public NexTouch
26 {
27 public: /* methods */
28 NexProgressBar(NexPid pid, NexCid cid, char *name);
29
30 bool getValue(uint32_t *number);
31 bool setValue(uint32_t number);
32 };
33
34 #endif /* #ifdef __cplusplus */
35 #endif /* #ifndef __NEXPROGRESSBAR_H__ */
NexProgressBar::setValue
bool setValue(uint32_t number)
Set the value of progress bar.
Definition: NexProgressBar.cpp:52
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
NexProgressBar
NexProgressBar,subclass of NexTouch,provides simple methods to control progress bar component...
Definition: NexProgressBar.h:25
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexSlice.cpp Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexSlice.cpp
Go to the documentation of this file.
1
16 #include "NexSlice.h"
17
22 NexSlice::NexSlice(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop, void *pop_ptr)
23 :NexTouch(pid, cid, name, pop, pop_ptr)
24 {
25 }
26
27 /*
28 * Get the number of picture.
29 *
30 * @param number - an output parameter to save the number of picture.
31 *
32 * @retval true - success.
33 * @retval false - failed.
34 */
35 bool NexSlice::getPic(uint32_t *number)
36 {
37 String cmd = String("get ");
38 cmd += getObjName();
39 cmd += ".picc";
40 sendCommand(cmd.c_str());
41 return recvRetNumber(number);
42 }
43
44 /*
45 * Set the number of picture.
46 *
47 * @param number - the number of picture.
48 *
49 * @retval true - success.
50 * @retval false - failed.
51 */
52 bool NexSlice::setPic(uint32_t number)
53 {
54 char buf[10] = {0};
55 String cmd;
56
57 utoa(number, buf, 10);
58 cmd += getObjName();
59 cmd += ".picc=";
60 cmd += buf;
61
62 sendCommand(cmd.c_str());
63 return recvRetCommandFinished();
64 }
65
72 void NexSlice::attachPop(NexTouchEventCb pop, void *ptr)
73 {
74 NexTouch::attachPop(pop, ptr);
75 }
76
81 void NexSlice::detachPop(void)
82 {
83 NexTouch::detachPop();
84 }
85
NexSlice::detachPop
void detachPop(void)
Unload slice pop callback function.
Definition: NexSlice.cpp:81
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
NexSlice::attachPop
void attachPop(NexTouchEventCb pop, void *ptr=NULL)
Register slice pop callback function.
Definition: NexSlice.cpp:72
NexSlice.h
API of NexSlice.
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexSlice.h Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexSlice.h
Go to the documentation of this file.
1
16 #ifndef __NEXSLICE_H__
17 #define __NEXSLICE_H__
18 #ifdef __cplusplus
19 #include "NexTouch.h"
20
25 class NexSlice: public NexTouch
26 {
27 public: /* methods */
28 NexSlice(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop = NULL, void *pop_ptr = NULL);
29
30 void attachPop(NexTouchEventCb pop, void *ptr = NULL);
31 void detachPop(void);
32
33 bool getPic(uint32_t *number);
34 bool setPic(uint32_t number);
35 };
36
37 #endif /* #ifdef __cplusplus */
38 #endif /* #ifndef __NEXSLICE_H__ */
NexSlice
NexSlice,subclass of NexTouch,provides simple methods to control slice component. ...
Definition: NexSlice.h:25
NexSlice::detachPop
void detachPop(void)
Unload slice pop callback function.
Definition: NexSlice.cpp:81
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
Generated on Thu Jul 16 2015 10:59:02 for API by doxygen 1.8.7


API: NexText.cpp Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexText.cpp
Go to the documentation of this file.
1
16 #include "NexText.h"
17
22 NexText::NexText(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop, void *pop_ptr)
23 :NexTouch(pid, cid, name, pop, pop_ptr)
24 {
25 }
26
35 uint16_t NexText::getText(char *buffer, uint16_t len)
36 {
37 String cmd;
38 cmd += "get ";
39 cmd += getObjName();
40 cmd += ".txt";
41 sendCommand(cmd.c_str());
42 return recvRetString(buffer,len);
43 }
44
53 bool NexText::setText(const char *buffer)
54 {
55 String cmd;
56 cmd += getObjName();
57 cmd += ".txt=\"";
58 cmd += buffer;
59 cmd += "\"";
60 sendCommand(cmd.c_str());
61 return recvRetCommandFinished();
62 }
63
70 void NexText::attachPop(NexTouchEventCb pop, void *ptr)
71 {
72 NexTouch::attachPop(pop, ptr);
73 }
74
79 void NexText::detachPop(void)
80 {
81 NexTouch::detachPop();
82 }
83
NexText::setText
bool setText(const char *buffer)
Set the value of text.
Definition: NexText.cpp:53
NexText::detachPop
void detachPop(void)
Unload text pop callback function.
Definition: NexText.cpp:79
NexText.h
API of NexText.
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
NexText::getText
uint16_t getText(char *buffer, uint16_t len)
Get the value of text.
Definition: NexText.cpp:35
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
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
Generated on Thu Jul 16 2015 10:59:03 for API by doxygen 1.8.7


API: NexText.h Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexText.h
Go to the documentation of this file.
1
16 #ifndef __NEXTEXT_H__
17 #define __NEXTEXT_H__
18 #ifdef __cplusplus
19 #include "NexTouch.h"
20
25 class NexText: public NexTouch
26 {
27 public: /* methods */
28 NexText(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop = NULL, void *pop_ptr = NULL);
29
30 void attachPop(NexTouchEventCb pop, void *ptr = NULL);
31 void detachPop(void);
32
33 uint16_t getText(char *buffer, uint16_t len);
34 bool setText(const char *buffer);
35 };
36
37 #endif /* #ifdef __cplusplus */
38 #endif /* #ifndef __NEXTEXT_H__ */
NexText::setText
bool setText(const char *buffer)
Set the value of text.
Definition: NexText.cpp:53
NexText::detachPop
void detachPop(void)
Unload text pop callback function.
Definition: NexText.cpp:79
NexText::getText
uint16_t getText(char *buffer, uint16_t len)
Get the value of text.
Definition: NexText.cpp:35
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
NexText
NexText,subclass of NexTouch,provides simple methods to control text component.
Definition: NexText.h:25
Generated on Thu Jul 16 2015 10:59:03 for API by doxygen 1.8.7


API: NexTouch.cpp Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexTouch.cpp
Go to the documentation of this file.
1
16 #include "NexTouch.h"
17
18 uint8_t NexTouch::__buffer[256] = {0};
19
26 uint8_t NexTouch::mainEventLoop(NexTouch **list)
27 {
28 uint16_t i;
29 uint8_t c;
30
31 while (true)
32 {
33 while (nexSerial.available() > 0)
34 {
35 delay(10);
36 c = nexSerial.read();
37
38 if (NEX_RET_EVENT_TOUCH_HEAD == c)
39 {
40 if (nexSerial.available() >= 6)
41 {
42 //memset(__buffer, 0, sizeof(__buffer));
43 __buffer[0] = c;
44 for (i = 1; i < 7; i++)
45 {
46 __buffer[i] = nexSerial.read();
47 }
48 __buffer[i] = 0x00;
49
50 if (0xFF == __buffer[4] && 0xFF == __buffer[5] && 0xFF == __buffer[6])
51 {
52 iterate(list, (NexPid)__buffer[1], (NexCid)__buffer[2], (NexEventType)__buffer[3]);
53 }
54
55 }
56 }
57 }
58 }
59 return 0;
60 }
61
74 NexTouch::NexTouch(NexPid pid, NexCid cid, char *name,
75 NexTouchEventCb pop, void *pop_ptr,
76 NexTouchEventCb push, void *push_ptr)
77 {
78 this->pid = pid;
79 this->cid = cid;
80 this->name = name;
81 this->cbPush = push;
82 this->cbPop = pop;
83 this->__cbpop_ptr = pop_ptr;
84 this->__cbpush_ptr = push_ptr;
85 }
86
92 NexPid NexTouch::getPid(void)
93 {
94 return pid;
95 }
96
102 NexCid NexTouch::getCid(void)
103 {
104 return cid;
105 }
106
112 const char* NexTouch::getObjName(void)
113 {
114 return name;
115 }
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(",");
131 if (name)
132 {
133 dbSerial.print(name);
134 }
135 else
136 {
137 dbSerial.print("(null)");
138 }
139 dbSerial.print(",");
140 dbSerial.print((uint32_t)cbPush);
141 dbSerial.print(",");
142 dbSerial.print((uint32_t)cbPop);
143 dbSerial.println("]");
144 }
145
146 void NexTouch::attachPush(NexTouchEventCb push, void *ptr)
147 {
148 this->cbPush = push;
149 this->__cbpush_ptr = ptr;
150 }
151
152 void NexTouch::detachPush(void)
153 {
154 this->cbPush = NULL;
155 this->__cbpush_ptr = NULL;
156 }
157
158 void NexTouch::attachPop(NexTouchEventCb pop, void *ptr)
159 {
160 this->cbPop = pop;
161 this->__cbpop_ptr = ptr;
162 }
163
164 void NexTouch::detachPop(void)
165 {
166 this->cbPop = NULL;
167 this->__cbpop_ptr = NULL;
168 }
169
170 void NexTouch::iterate(NexTouch **list, NexPid pid, NexCid cid, NexEventType event)
171 {
172 NexTouch *e = NULL;
173 uint16_t i = 0;
174
175 if (NULL == list)
176 {
177 return;
178 }
179
180 for(i = 0; (e = list[i]) != NULL; i++)
181 {
182 if (e->getPid() == pid && e->getCid() == cid)
183 {
184 e->print();
185 if (NEX_EVENT_PUSH == event)
186 {
187 e->push();
188 }
189 else if (NEX_EVENT_POP == event)
190 {
191 e->pop();
192 }
193
194 break;
195 }
196 }
197 }
198
199 void NexTouch::push(void)
200 {
201 if (cbPush)
202 {
203 cbPush(__cbpush_ptr);
204 }
205 }
206
207 void NexTouch::pop(void)
208 {
209 if (cbPop)
210 {
211 cbPop(__cbpop_ptr);
212 }
213 }
214
224 bool NexTouch::recvRetCommandFinished(uint32_t timeout)
225 {
226 bool ret = false;
227 uint8_t temp[4] = {0};
228
229 nexSerial.setTimeout(timeout);
230 if (sizeof(temp) != nexSerial.readBytes((char *)temp, sizeof(temp)))
231 {
232 ret = false;
233 }
234
235 if (temp[0] == NEX_RET_CMD_FINISHED
236 && temp[1] == 0xFF
237 && temp[2] == 0xFF
238 && temp[3] == 0xFF
239 )
240 {
241 ret = true;
242 }
243
244 if (ret)
245 {
246 dbSerial.println("recvRetCommandFinished ok");
247 }
248 else
249 {
250 dbSerial.println("recvRetCommandFinished err");
251 }
252
253 return ret;
254 }
255
261 void NexTouch::sendCommand(const char* cmd)
262 {
263 while (nexSerial.available())
264 {
265 nexSerial.read();
266 }
267
268 nexSerial.print(cmd);
269 nexSerial.write(0xFF);
270 nexSerial.write(0xFF);
271 nexSerial.write(0xFF);
272 }
273
284 uint16_t NexTouch::recvRetString(char *buffer, uint16_t len, uint32_t timeout)
285 {
286 uint16_t ret = 0;
287 bool str_start_flag = false;
288 uint8_t cnt_0xff = 0;
289 String temp = String("");
290 uint8_t c = 0;
291 long start;
292
293 if (!buffer || len == 0)
294 {
295 goto __return;
296 }
297
298 start = millis();
299 while (millis() - start <= timeout)
300 {
301 while (nexSerial.available())
302 {
303 c = nexSerial.read();
304 if (str_start_flag)
305 {
306 if (0xFF == c)
307 {
308 cnt_0xff++;
309 if (cnt_0xff >= 3)
310 {
311 break;
312 }
313 }
314 else
315 {
316 temp += (char)c;
317 }
318 }
319 else if (NEX_RET_STRING_HEAD == c)
320 {
321 str_start_flag = true;
322 }
323 }
324
325 if (cnt_0xff >= 3)
326 {
327 break;
328 }
329 }
330
331 ret = temp.length();
332 ret = ret > len ? len : ret;
333 strncpy(buffer, temp.c_str(), ret);
334
335 __return:
336
337 dbSerial.print("recvRetString[");
338 dbSerial.print(temp.length());
339 dbSerial.print(",");
340 dbSerial.print(temp);
341 dbSerial.println("]");
342
343 return ret;
344 }
345
356 bool NexTouch::recvRetNumber(uint32_t *number, uint32_t timeout)
357 {
358 bool ret = false;
359 uint8_t temp[8] = {0};
360
361 if (!number)
362 {
363 goto __return;
364 }
365
366 nexSerial.setTimeout(timeout);
367 if (sizeof(temp) != nexSerial.readBytes((char *)temp, sizeof(temp)))
368 {
369 goto __return;
370 }
371
372 if (temp[0] == NEX_RET_NUMBER_HEAD
373 && temp[5] == 0xFF
374 && temp[6] == 0xFF
375 && temp[7] == 0xFF
376 )
377 {
378 *number = (temp[4] << 24) | (temp[3] << 16) | (temp[2] << 8) | (temp[1]);
379 ret = true;
380 }
381
382 __return:
383
384 if (ret)
385 {
386 dbSerial.print("recvRetNumber :");
387 dbSerial.println(*number);
388 }
389 else
390 {
391 dbSerial.println("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
NexTouch::getPid
NexPid getPid(void)
Get page id.
Definition: NexTouch.cpp:92
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
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
NexTouch::getCid
NexCid getCid(void)
Get component id.
Definition: NexTouch.cpp:102
NexTouch.h
API of Nextion.
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
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
Generated on Thu Jul 16 2015 10:59:03 for API by doxygen 1.8.7


API: NexTouch.h Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
NexTouch.h
Go to the documentation of this file.
1
16 #ifndef __NEXTOUCH_H__
17 #define __NEXTOUCH_H__
18 #ifdef __cplusplus
19 #include <Arduino.h>
20
21
22 /*Define debug serial*/
23 #define dbSerial Serial
24
25 /*Define Nextion serial*/
26 #define nexSerial Serial2
27
28 typedef uint8_t NexPid;
29 typedef uint8_t NexCid;
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);
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__ */
NexTouch::getPid
NexPid getPid(void)
Get page id.
Definition: NexTouch.cpp:92
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
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
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
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
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
Generated on Thu Jul 16 2015 10:59:03 for API by doxygen 1.8.7


API: Member List

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
NexButton Member List

This is the complete list of members for NexButton, including all inherited members.

attachPop(NexTouchEventCb pop, void *ptr=NULL) | NexButton |
detachPop(void) | NexButton |
getCid(void) | NexTouch |
getObjName(void) | NexTouch |
getPid(void) | NexTouch |
getText(char *buffer, uint16_t len) | NexButton |
mainEventLoop(NexTouch **list) | NexTouch | static
NexButton(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL) | NexButton |
NexTouch(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL) | NexTouch |
print(void) | NexTouch |
recvRetCommandFinished(uint32_t timeout=100) | NexTouch | static
recvRetNumber(uint32_t *number, uint32_t timeout=500) | NexTouch | static
recvRetString(char *buffer, uint16_t len, uint32_t timeout=500) | NexTouch | static
sendCommand(const char *cmd) | NexTouch | static
setText(const char *buffer) | NexButton |


API: Member List

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
NexHotspot Member List

This is the complete list of members for NexHotspot, including all inherited members.

attachPop(NexTouchEventCb pop, void *ptr=NULL) | NexHotspot |
attachPush(NexTouchEventCb push, void *ptr=NULL) | NexHotspot |
detachPop(void) | NexHotspot |
detachPush(void) | NexHotspot |
getCid(void) | NexTouch |
getObjName(void) | NexTouch |
getPid(void) | NexTouch |
mainEventLoop(NexTouch **list) | NexTouch | static
NexHotspot(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL) | NexHotspot |
NexTouch(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL) | NexTouch |
print(void) | NexTouch |
recvRetCommandFinished(uint32_t timeout=100) | NexTouch | static
recvRetNumber(uint32_t *number, uint32_t timeout=500) | NexTouch | static
recvRetString(char *buffer, uint16_t len, uint32_t timeout=500) | NexTouch | static
sendCommand(const char *cmd) | NexTouch | static


API: Member List

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
NexPage Member List

This is the complete list of members for NexPage, including all inherited members.

attachPop(NexTouchEventCb pop, void *ptr=NULL) | NexPage |
detachPop(void) | NexPage |
getCid(void) | NexTouch |
getObjName(void) | NexTouch |
getPid(void) | NexTouch |
mainEventLoop(NexTouch **list) | NexTouch | static
NexPage(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL) | NexPage |
NexTouch(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL) | NexTouch |
print(void) | NexTouch |
recvRetCommandFinished(uint32_t timeout=100) | NexTouch | static
recvRetNumber(uint32_t *number, uint32_t timeout=500) | NexTouch | static
recvRetString(char *buffer, uint16_t len, uint32_t timeout=500) | NexTouch | static
sendCommand(const char *cmd) | NexTouch | static
show(void) | NexPage |


API: Member List

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
NexPicture Member List

This is the complete list of members for NexPicture, including all inherited members.

attachPop(NexTouchEventCb pop, void *ptr=NULL) | NexPicture |
detachPop(void) | NexPicture |
getCid(void) | NexTouch |
getObjName(void) | NexTouch |
getPic(uint32_t *number) | NexPicture |
getPid(void) | NexTouch |
mainEventLoop(NexTouch **list) | NexTouch | static
NexPicture(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL) | NexPicture |
NexTouch(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL) | NexTouch |
print(void) | NexTouch |
recvRetCommandFinished(uint32_t timeout=100) | NexTouch | static
recvRetNumber(uint32_t *number, uint32_t timeout=500) | NexTouch | static
recvRetString(char *buffer, uint16_t len, uint32_t timeout=500) | NexTouch | static
sendCommand(const char *cmd) | NexTouch | static
setPic(uint32_t number) | NexPicture |


API: Member List

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
NexPointer Member List

This is the complete list of members for NexPointer, including all inherited members.

getCid(void) | NexTouch |
getObjName(void) | NexTouch |
getPid(void) | NexTouch |
getValue(uint32_t *number) | NexPointer |
mainEventLoop(NexTouch **list) | NexTouch | static
NexPointer(NexPid pid, NexCid cid, char *name) | NexPointer |
NexTouch(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL) | NexTouch |
print(void) | NexTouch |
recvRetCommandFinished(uint32_t timeout=100) | NexTouch | static
recvRetNumber(uint32_t *number, uint32_t timeout=500) | NexTouch | static
recvRetString(char *buffer, uint16_t len, uint32_t timeout=500) | NexTouch | static
sendCommand(const char *cmd) | NexTouch | static
setValue(uint32_t number) | NexPointer |


API: Member List

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
NexProgressBar Member List

This is the complete list of members for NexProgressBar, including all inherited members.

getCid(void) | NexTouch |
getObjName(void) | NexTouch |
getPid(void) | NexTouch |
getValue(uint32_t *number) | NexProgressBar |
mainEventLoop(NexTouch **list) | NexTouch | static
NexProgressBar(NexPid pid, NexCid cid, char *name) | NexProgressBar |
NexTouch(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL) | NexTouch |
print(void) | NexTouch |
recvRetCommandFinished(uint32_t timeout=100) | NexTouch | static
recvRetNumber(uint32_t *number, uint32_t timeout=500) | NexTouch | static
recvRetString(char *buffer, uint16_t len, uint32_t timeout=500) | NexTouch | static
sendCommand(const char *cmd) | NexTouch | static
setValue(uint32_t number) | NexProgressBar |


API: Member List

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
NexSlice Member List

This is the complete list of members for NexSlice, including all inherited members.

attachPop(NexTouchEventCb pop, void *ptr=NULL) | NexSlice |
detachPop(void) | NexSlice |
getCid(void) | NexTouch |
getObjName(void) | NexTouch |
getPid(void) | NexTouch |
mainEventLoop(NexTouch **list) | NexTouch | static
NexSlice(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL) | NexSlice |
NexTouch(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL) | NexTouch |
print(void) | NexTouch |
recvRetCommandFinished(uint32_t timeout=100) | NexTouch | static
recvRetNumber(uint32_t *number, uint32_t timeout=500) | NexTouch | static
recvRetString(char *buffer, uint16_t len, uint32_t timeout=500) | NexTouch | static
sendCommand(const char *cmd) | NexTouch | static


API: Member List

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
NexText Member List

This is the complete list of members for NexText, including all inherited members.

attachPop(NexTouchEventCb pop, void *ptr=NULL) | NexText |
detachPop(void) | NexText |
getCid(void) | NexTouch |
getObjName(void) | NexTouch |
getPid(void) | NexTouch |
getText(char *buffer, uint16_t len) | NexText |
mainEventLoop(NexTouch **list) | NexTouch | static
NexText(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL) | NexText |
NexTouch(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL) | NexTouch |
print(void) | NexTouch |
recvRetCommandFinished(uint32_t timeout=100) | NexTouch | static
recvRetNumber(uint32_t *number, uint32_t timeout=500) | NexTouch | static
recvRetString(char *buffer, uint16_t len, uint32_t timeout=500) | NexTouch | static
sendCommand(const char *cmd) | NexTouch | static
setText(const char *buffer) | NexText |


API: Member List

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
NexTouch Member List

This is the complete list of members for NexTouch, including all inherited members.

getCid(void) | NexTouch |
getObjName(void) | NexTouch |
getPid(void) | NexTouch |
mainEventLoop(NexTouch **list) | NexTouch | static
NexTouch(NexPid pid, NexCid cid, char *name, NexTouchEventCb pop=NULL, void *pop_ptr=NULL, NexTouchEventCb push=NULL, void *push_ptr=NULL) | NexTouch |
print(void) | NexTouch |
recvRetCommandFinished(uint32_t timeout=100) | NexTouch | static
recvRetNumber(uint32_t *number, uint32_t timeout=500) | NexTouch | static
recvRetString(char *buffer, uint16_t len, uint32_t timeout=500) | NexTouch | static
sendCommand(const char *cmd) | NexTouch | static


API: Main Page

API
  • Related Pages
  • Classes
  • Files
  • Examples
API Documentation

Nextion Library for Arduino

Nextion Arduino library provides an easy-to-use way to manipulate Nextion serial displays. Users can use the libarry freely, either in commerical projects or open-source prjects, without any additional condiitons.

For more information about the Nextion display project, please visit the wiki。 The wiki provdies all the necessary technical documnets, quick start guide, tutorials, demos, as well as some useful resources.

To get your Nextion display, please visit iMall.

To discuss the project? Request new features? Report a BUG? please visit the Forums

​

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

Hareware requirement

  • RAM: not less than 2KBytes
  • Serial: two serial (communication and debug)

Suppported Mainboards:

  • Iteaduino MEGA2560
  • Arduino MEGA2560

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

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.


API: Related Pages

API
  • Related Pages
  • Classes
  • Files
  • Examples
Related Pages
Here is a list of all related documentation pages:
readme


API: readme.md Source File

API
  • Related Pages
  • Classes
  • Files
  • Examples
  • File List
  • File Members
readme.md
1 @mainpage
2
3 # Nextion Library for Arduino
4
5 Nextion Arduino library provides an easy-to-use way to manipulate Nextion serial displays.
6 Users can use the libarry freely, either in commerical projects or open-source prjects, without any additional condiitons.
7
8 For more information about the Nextion display project, please visit [the wiki。](http://wiki.iteadstudio.com/Nextion_HMI_Solution)
9 The wiki provdies all the necessary technical documnets, quick start guide, tutorials, demos, as well as some useful resources.
10
11 To get your Nextion display, please visit [iMall.](http://imall.itead.cc/display/nextion.html)
12
13 To discuss the project? Request new features? Report a BUG? please visit the [Forums](http://support.iteadstudio.com/discussions/1000058038)
14
15 ​
16 # Source
17
18 Latest source code can be download at https://github.com/itead/ITEADLIB_Arduino_Nextion.
19
20 You can clone it by:
21
22 git clone https://github.com/itead/ITEADLIB_Arduino_Nextion
23
24 # Hareware requirement
25
26 - RAM: not less than 2KBytes
27 - Serial: two serial (communication and debug)
28
29 # Suppported Mainboards:
30
31 - Iteaduino MEGA2560
32 - Arduino MEGA2560
33
34
35 -------------------------------------------------------------------------------
36
37
38 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
39 Version 2, December 2004
40
41 Copyright (C) 2014 ITEAD Studio
42
43 Everyone is permitted to copy and distribute verbatim or modified
44 copies of this license document, and changing it is allowed as long
45 as the name is changed.
46
47 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
48
49 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
50
51 0. You just DO WHAT THE FUCK YOU WANT TO.
52
53
54 -------------------------------------------------------------------------------