Please refer to your Hardware Documentation
Please ensure the Iteadlib Arduino Nextion Library is installed
A Leonardo has Serial and Serial1
Therefore you should edit your NexConfig.h file
- this will be located in your Arduino folders in Documents
Please refer to Arduino.cc and your Leonardo documentation
- on use of what #define means
such incorrect usage creates an error
- as such remove line 2 from your script
Edits to your NexConfig.h file, please ensure
#define dbSerial Serial
#define nexSerial Serial1
Once this is done you should be able to remove line 38
By configuration Serial will be used for Serial Monitor
and Serial1 will be used for Nextion communications
Thank you for this answer, I have done everything that you have said but it sends me new errors:
"In file included from U:\Arduino\libraries\ITEADLIBArduinoNextionmaster\NexUpload.cpp:16:
U:\Arduino\libraries\ITEADLIBArduinoNextionmaster\/NexUpload.h:133: error: 'File' does not name a type
U:\Arduino\libraries\ITEADLIBArduinoNextionmaster\NexUpload.cpp: In member function 'bool NexUpload::_checkFile()':
U:\Arduino\libraries\ITEADLIBArduinoNextionmaster\NexUpload.cpp:91: error: 'SD' was not declared in this scope
U:\Arduino\libraries\ITEADLIBArduinoNextionmaster\NexUpload.cpp:96: error: 'SD' was not declared in this scope
U:\Arduino\libraries\ITEADLIBArduinoNextionmaster\NexUpload.cpp:100: error: '_myFile' was not declared in this scope
U:\Arduino\libraries\ITEADLIBArduinoNextionmaster\NexUpload.cpp:100: error: 'SD' was not declared in this scope
U:\Arduino\libraries\ITEADLIBArduinoNextionmaster\NexUpload.cpp: In member function 'bool NexUpload::_downloadTftFile()':
U:\Arduino\libraries\ITEADLIBArduinoNextionmaster\NexUpload.cpp:210: error: '_myFile' was not declared in this scope
U:\Arduino\libraries\ITEADLIBArduinoNextionmaster\NexUpload.cpp:224: error: '_myFile' was not declared in this scope"
I don't know what this error means, could you help me once again if possible ?
delete for now, the two files NexUpload.h and NexUpload.cpp
Ah It works thank you so much !
Glad to hear. Happy Coding
Some days ago the program worked and the number increased or decreased it depended which button I have pressed but now It doesn't work when I press on buttonPlus or buttonMoins the number doesn't change, it still 50 on my screen.
I checked the serial monitor on the arduino it sends me this message every time I release/push (depend which button) a button "recvRetCommandFinished err " I don't know what this message mean.
Could you help me if possible.
rather than analyzing the error you should think more on what you exactly did between "working" and "not working" ...
in general, nothing happens without a reason ... software wont change by itself, so there must have been an user interaction for this ...
I am agree with you but I don't remember to change something between yesterday and today.
I just have followed the steps from Patrick then the program worked I could push/release the button it will increase/decrease the textnumber and now I retry and It doesn't work I don't even how
Have you restarted both Nextion and MCU?
Yes I have done this, I have verified the NexConfig.h , each lines of the Arduino code and check if each buttons was correctly set up (component id etc...)
Double check all is common ground? Loose wire?
Oh I found what was the problem, the last day I missclicked I have deleted the text component so I replaced it and I forget to rename It....
I'm sorry for the trouble!
And thank you for your answers :)