So I am pretty much stuck, since every tutorial and example I have tried I get similar errors. But they all surround the central point of changing a text or a number. I have the 5 in enhanced version and currently using the mega. The errors I get are recvRetNumber err, recvRetCommandFinished err for the compnumber and comptext examples.
This dbserial is printed to Serial monitor in the NexHardware.cpp file
- it is there to let you know that it the last command has passed/failed
- when result is err, it generally means serial is not configured properly.
The Iteadlib comes preconfigured for MEGA at Serial2 RX2/TX2 at 9600 baud.
(see readme.md file of the Iteadlib)
Nextion default baud rate from factory is 9600 baud.
Have 9600 baud set on the .ino file. RX and TX connected to TX2 and RX2. In NewConfig have
#define dbSerial Serial #define nexSerial Serial2
I get transmit and receive lights on the Arduino and get data on the serial monitor, but the last line is the err.
I am literally trying to use the example code in the itead Arduino library with a modified tft through the editor to allow for appropriate use.
- modified HMI file
- ino file
Here are the four files. I am using the 5 inch enhanced nextion.
There are the modified ones?
The HMI files are just modified for my device.
All I am trying to do is get it to work, to understand the concepts and methodology.
Sorry, perhaps NewConfig was meant as NexConfig.
Show what your serial monitor output is ...
Yes, my apologies.
recvRetCommandFinished err recvRetCommandFinished err setup done [1778:0,3,b1] b1PopCallback recvRetString[0,] recvRetCommandFinished err [1790:0,2,b0] b0PopCallback recvRetString[0,] recvRetCommandFinished err [1778:0,3,b1] b1PopCallback recvRetString[0,] recvRetCommandFinished err
This is from boot,(minus),(plus),(minus) or the Comptext example
Methodology (seen in Iteadlib code) is ....
- #define will replace dbSerial and nexSerial with your Serial and Serial2 (defaults)
- creates object structure for page, component id and objname used in a declaration
NexComponent myComponent = NexComponent(pageno,compid,objname)
- Inherits NexObject adds function pointers for Push (Press) and Pop (Released) events
- nexInit() initial settings, baudrate, bkcmd, page 0 start
- nexLoop() if touch received, calls iterate, if function attached - calls parameter function
- other supporting
- function for each green attribute that is changeable at runtime, getValue() setValue() etc
- one Nex_____ for each component (NexText, NexButton ... etc)
- file of master #includes
- compiler will create code only for what was used.
All functions basically parse out to the equivalent Nextion Instruction Set terminated formats
That's what I was gathering, but why won't the examples work at least with the enhanced 5 inch?