Nextion Instruction Set

From ITEAD Wiki
Revision as of 07:23, 12 May 2015 by ITead (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Note:

1. The instruction is end with three bytes “0xff 0xff 0xff”

2. All the instrucitons and parametners are in ASCII.

3. All the instrucitons are in lowercase letters

Classification I: Operation Commands of Component and System

page pageid

pageid: Page ID or Page Name

Instance 1: 
page 0         //Refresh the page with page ID of 0
Instance 2: 
page main    //Refresh the page with page name of main

Remarks:

The device automatically refresh page 0 when power on.


ref component's ID

component's ID: the component to refresh

Instance: ref t0   //refresh component t0

Remarks:

The default loading mode is automatically load when you create and edit a component in Nextion Editor. If set it as manually load, you should use ref command to load the component. Or when the component is covered by the other components, you can use this command to refresh the covered component.


get att

att: Name of Variable

Instance 1
get t0.txt      //return t0's txt value
Instance 2
get j0.val    //return J0's val value

Remarks:

1. When returned value is a string, the returned data is 0X70+ASCII code+0xff 0xff 0xff.

2. When returned value is numerical data, returned data is 0X71+4 byte binary data+0xff 0xff 0xff. The data storage mode is little-endian mode (namely, low-order in front, and high-order at back).

3. The specific returning format of data, please refer to the table: Format of Device Return Data


sendme

Instance: 
sendme  / /No parameter

Remarks:

Device will immediately send the current page ID to serial port after receiving this instruction.

The specific sending format of data, please refer to the table: Format of Device Return Data.


touch_j

Instance 1: 
touch_j   //Enter touch calibration function, this command does not need parameter

Remarks:

All the devices have been calibrated, this command is not needed under normal circumstances


cle_c

Instance 1: 
cle_c  //This command does not need parameter

Remarks:

When you use this command, all touch areas you set in the current page will neither be valid, nor automatically be identified.Until you use the "page" command, the touch areas can be reloaded.


com_stop

Instance 1: com_stop  //This instruction does not need parameter

Remarks:

This command is used for pausing the execution of serial port commands, but note that the device will continue receiving the commands and store them in the buffer. Until receiving "com_star" commands, the device will execute the rest commands that store in the buffer.

When using this command to pause the execution, please make sure whether the buffer size and the maximum capacity of command queue can store all the commands you need. You will find these two parameter in Nextion Hardware manual.


com_star

Instance 1: com_star  //This instruction does not need parameter

Remarks:

After receiving this command, the device will execute all the commands that store in the buffer.

When using this command to recover the execution, please make sure whether the buffer size and the maximum capacity of command queue can store all the commands you need. You will find these two parameter in Nextion Hardware manual.


code_c

Instance 1: code _c   //This instruction does not need parameter

Clear the commands that is stored in the buffer but not executed.