I'm new to Nextion display. I'm doing a model of oscilloscope with the display and an Arduino Uno. I used the waveform component. I went through the instruction set and found two instructions to send data to the waveform component. The instruction "add" is clear to me. Tried and got the output. But the instruction "addt" is not clear to me. I sent the instruction

addt 1,0,30\xFF\xFF\xFF

I got something on the display which I'm not able to understand. Please someone explain what the instruction "addt" does....... I also came across the term "data pass through mode" under this instruction in the documentation. Please explain that too.....

Thanks in Advance.....

  • Do you know the "nextion instruction set" page? itead.cc/wiki/… – Jot Jan 1 at 16:59
  • Yes....I have gone through it. I learner about add instruction from that only. But I'm not able to understand what addt instruction does..... – Aravind S Jan 1 at 17:06
  • The third parameter for the "add" command is "val", the value. The third parameter for the "addt" command is "qty", the number of bytes that will follow. In your example you have '30', so you need 30 bytes with data between '30' and '\xFF\xFF\xFF'. – Jot Jan 1 at 17:14
  • So, do I have to give 30 values with commas between "30" and "\xFF\xFF\xFF"???? – Aravind S Jan 1 at 17:18
  • I'm not sure anymore how this special mode works. I'm looking for an example but did not find it yet. I think the addt command has to be closed by the '\xFF\xFF\xFF' and after that the data follows. – Jot Jan 1 at 18:29

addt is the volume variant of add.

Instead of using something like:

add 1, 0, 19
add 1, 0, 39
add 1, 0, 85
add 1, 0, 98

you can group them all together with an addt:

addt 1, 0, 4
<5ms delay>

The third parameter of the addt command is the number of values you want to send. Then you have to leave at least 5ms after sending the command so the display is ready to receive (it will actually send a "go" signal to you of \xFE\xFF\xFF\xFF. You send the data as raw binary values (shown as C string escape sequences above), and after it has received the specified number it responds with an "ok" signal of \xFD\xFF\xFF\xFF.

The maximum number of values you can send in one batch is 128.

  • I tried a sample code... SofwareSerial nextion(10,11); nextion.print("addt 1,0,5"); delay(5); nextion.print("\x12\x13\x14\x15\x16\xFF\xFF\xFF"); didn't get anything on the screen. Is what I wrote wrong??? – Aravind S Jan 1 at 17:40
  • Please ignore the spelling of SoftwareSerial in the above comment – Aravind S Jan 1 at 17:51
  • @Majenko, could you add the \xFF\xFF\xFF after the 'addt' command, and add reading the 'go' signal from the serial input in your pseudo code? – Jot Jan 1 at 18:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.