Start a new topic

Compnumber Example is not working for me

Hello, I am working on a project that includes the Number box on the Nextion IDE. I have been looking at tutorials and have followed the CompNumber example that comes with the Nextion Library and it does not work for me. Could I get some assistance as to what I'm doing wrong?

Thanks,

- Juan

Please describe "what" is not working, too vague.

Also see thread * Arduino Nextion Examples

http://support.iteadstudio.com/support/discussions/topics/11000009208

The compnumber example doesn't increase or decrease the value in the n0 box. I have attached the files I'm using to hopefully give a better example of what's going on.


I recreated the compnumber hmi, because the one I had couldn't update to the new version of Nextion.


Here are the errors I receive on the Serial Monitor:


ÿÿÿbkcmd=1ÿÿÿrecvRetCommandFinished err
page 0ÿÿÿrecvRetCommandFinished err
setup done
[638:0,1,b0]
b0PopCallback
get n0.valÿÿÿrecvRetNumber err
n0.val=38657ÿÿÿrecvRetCommandFinished err
[638:0,1,b0]
b0PopCallback
get n0.valÿÿÿrecvRetNumber err
n0.val=38657ÿÿÿrecvRetCommandFinished err
[626:0,2,b1]
b1PopCallback
get n0.valÿÿÿrecvRetNumber err
n0.val=49407ÿÿÿrecvRetCommandFinished err
ÿÿÿbkcmd=1ÿÿÿrecvRetCommandFinished err
page 0ÿÿÿrecvRetCommandFinished ok
setup done
[638:0,1,b0]
b0PopCallback
get n0.valÿÿÿrecvRetNumber err
n0.val=38657ÿÿÿrecvRetCommandFinished err
[626:0,2,b1]
b1PopCallback
get n0.valÿÿÿrecvRetNumber err
n0.val=49407ÿÿÿrecvRetCommandFinished err


Could you tell me what I'm doing wrong?


I didn't add anything to the code. My pins used on the Arduino Uno are 5V, GND, RX, TX

HMI
ino
(2.83 KB)

I checked that thread.... being that I have V0.43.... does that make the files just not work?


So when you say nothing was added

- which library are you using?


- have you read your UNO documentation?

- have you read the readme.md of the library?



oh ok... the version text file says its V0.9.0. Could you give me the link to the updated Nextion Library?


having v0.43 will not make it fail

 - files that are too will not upload to the Nextion displays

 - tft files made with versions v0.37 or lower will fail upload

as such the examples in that thread were brought up to date


Did you alter the NexConfig.h to suit your uno?


v0.9.0 IteadLib Arduino Nextion Library is the latest.


sorry skipped one of your questions.


The library is called ITEADLIB_Arduino_Nextion-master

So how many Serial ports on the UNO?


Just 1. also I was looking at the readme and I changed the dbserial and nex serial to following:


 * Define DEBUG_SERIAL_ENABLE to enable debug serial.
 * Comment it to disable debug serial.
 */
//#define DEBUG_SERIAL_ENABLE

/**
 * Define dbSerial for the output of debug messages.
 */
//#define dbSerial Serialxxx

/**
 * Define nexSerial for communicate with Nextion touch panel.
 */
#define nexSerial Serialxxx



I continued to the nextion hoping that worked but this error came up:



C:Documents\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexConfig.h:37:19: error: 'Serialxxx' was not declared in this scope

 #define nexSerial Serialxxx

  ^

C:Documents\Arduino\libraries\ITEADLIB_Arduino_Nextion-master\NexHardware.cpp:55:5: note: in expansion of macro 'nexSerial'

  nexSerial.setTimeout(timeout);

  ^


The readme.md needed you to define your serial to Serial
(SerialXXX not literal but being Serial, Serial1,Serial2,Serial3)
As the Uno only has one Serial, it needed to be

#define nexSerial Serial




Wow, sorry I am new at this and thought maybe it will accept any number. Didn't realize I had to specify XD

IT WORKS!!!! Thank You SO MUCH!


Without specifying how would the compiler know which machine codes to use?
MCUs are super specific - they only do exactly as you tell them to do.

Pay attention to the top compile error,

 - fixing the first one on top most often fix lower ones that depended on the top one.


As you see your error was complaining on Serialxxx

 - so this is what needs to be fixed


So up and running yet? 

You wont be getting serial monitor feedback - as you only have the one serial


Login or Signup to post a comment