I agree the documentation is lacking,
Here are a couple of links that beginners may find helpful.https://www.itead.cc/wiki/Nextion_Instruction_Sethttp://support.iteadstudio.com/support/discussions/topics/1000065323
Also, the library has a few limitations. Specifically the one that caused me some grief was that the library only takes uint32 values for the number boxes. This means no negative numbers. It also does not seem to like decimal points... Needs work.
You do not have to use the library and can send the commands as text to the display over the serial port.
// Generate Display Data
EGT1 = (((strtol(&rxWord1,0,16)*256)+strtol(&rxWord1,0,16))*0.18)-40;
// Display the EGTs
Serial2.print("page1.n0.val=" + String(EGT1));
Serial2.write(0xff); // sending 3 "0xff" tell the nextion that the command is complete...
I have noticed that you really need to not use blocking delays in you code (arduino: delay(500)
Obviously this delays the processor and will prevent it from processing the incoming commands from the display.
If you are doing two way communication from the display back to the MCU, then you should if using the library, scatter
throughout your application to help catch and process the incoming commands in a timely manner. That is a library function included in the library for the arduino.
Using the attachPop and attachPush calls to objects on the display are helpful to catching events.
Here is a link explaining them.http://support.iteadstudio.com/support/discussions/topics/1000062402
I have found most everything I have needed from these pages and by dissecting the demo apps available in the second link.
Hope someone finds this helpful...Posted on: October 28, 2016, 04:15:58 am - Automerged
Here are 2 links to a bezel for the 4.3" display and a windshield mount for the 2.4" display.
I created the 4.3 bezel copying the measurements from my displays and the STL files from Itead.https://grabcad.com/library/nextion-4-3-bezel-1
The 2.4 windshield mount was designed by my to mount the 2.4" display between my rear view mirror and the headliner in my truck. I use it to display OBD II data.https://grabcad.com/library/windshield-box-mount-1