Start a new topic

Why is this happening? "nexbutton" does not name a type

Salve a tutti, sono nuovo e sono un principiante.

Sto imparando Arduino come pure utilizzare il display nextion.

Ma ho un problema.

Utilizzando gli esempi della libreria come CompButton_v0_32 non riesco a caricare lo sketch su arduino.

Viene comunicato un errore << "nexbutton" does not name a type >>.

Come posso risolvere questo problema, dove sto sbagliando?


Reopen in English



1 person likes this

Hi everyone, I'm new and I'm a beginner.

I'm learning Arduino as well as using the nextion display.

But I have a problem.

Using library examples like CompButton_v0_32 I can not load the arduino sketch.

An error is reported << "nexbutton" does not name a type >>.

How can I fix this problem, where am I wrong?

Learning Arduino is at Arduino.cc


NexButton <> nexbutton

Precision, attention to details, case sensitivity of C++ language


I know that C ++ is case sensitive.

I copy the sample example without modifying it.

As you can see from the attached images.

I also attach a .txt file that returns all the errors communicated by the arduino IDE

I hope that with this information I can be useful to explain what happens.

thank you

txt
(2.14 KB)

Then if you know that C++ is case sensitive why then did you twice report:

    << "nexbutton" does not name a type >>. 

When it was NexButton does not name a type.


Arduino error is descriptive. File and line of error.

So this means that there is no "NexButton" type defined in your used library.

Such meanings and learning your Arduino C++ and compiler: -> ardunino.cc


But then, this then begs to ask - what library are you using.

You called #include "Nextion.h" so ... look into Nextion.h and examine code.



1 person likes this

Thanks to Patrick, you turned on the magic bulb in my brain.

I'm learning to use arduino ... I'm at the beginning.

Sorry if I stole you time.

I used a NOENEXTION library of DAN NIXON Vs. 2.2.0

Now, thanks to you, I also learned how to add a new library to the arduino card.

If I have other problems in the future I can always hope for your collaboration?

A greeting.

Now I get this kind of error:

exit status 1

Error while compiling for Arduino / Genuino Uno board.

You will need many hours learning your Arduino C++ language, IDE and compiler.

There are no shortcuts for such

Mr Patrick, you're right I'm studying how arduino program is.

But if I take any files contained in the "examples" folder such as CompButton_v0_32.in and uploading them to the IDE always receive the compile error

exit status 1

Error while compiling for Arduino / Genuino One board.

I do not change anything in the code. There is no need for C ++ language preparation or use of arduino IDE.

If you can help me thank you for still not being able to try my lcd nextion purchase.

Thank you.

Did you read the Nextion FAQs?


Then you will have seen the link to the Iteadlib Arduino Nextion Library

When you visit the GitHub then you read the important

The UNO needs some modifications described in this readme.md file.

It is already big bold 400pt font.


The exit status 1 is not interesting

The first line of the compile error is the interesting.

Fix the first error and many other errors disappear.


But CompButton_v0_32.ino requires the Iteadlib Arduino Nextion Library

Another library code, and it will fail.


When you say there is no need for

  C++ language preparation ... you fail to recognize #define meaning

  Arduino C++ is not full C++, but a special restrictive subset of C++

  Arduino IDE preparation ... you fail to install the proper libraries

  The Arduino compiler ... you fail to understand the error codes so you can correct.

  Your used MCU .. the documentation of the UNO is over 300 pages.


Nextion is used with over 130 programming languages for 65000+ MCUs

Arduino C++ is only one language, UNO is only one MCU.

It is user duty to know their tools of choice.

 

I didn't choose Arduino C++, rather I chose to program in Pascal

I didn't choose the Arduino IDE, rather I chose mikroPascal Pro for ARM

I didn't choose the UNO as MCU, rather I chose the STM32F103RBT8


In this manner, the user must know their

  chosen programming language, chosen compiler, and chosen MCU.


Nextion commands are text based

   send n0.val=234ÿÿÿ

   and Nextion takes care of changing n0 to 234

   send t0.txt="Hello"ÿÿÿ

   and Nextion takes care of changing t0 to Hello

The Nextion will send back Return Data

 

This is described in the Nextion Instruction Set.


So when I say you will need many hours, there are no shortcuts

The shortcut is Nextion creating your GUI

The shortcut is checking the Send Component ID checkbox

and in this fashion your project can be done in a week, not months.


But one still has to handle their "not Nextion" side.

Programming and Electronics are prerequisites

You can't start with out knowing how to code and follow compiler errors.

For this, there are resources

   Arduino IDE, C++ and UNO documentation is at Arduino.cc

   mikroPascal is at mikroe.com

   STM32F103RBT8 is at st.com

   

Nextion is at nextion.itead.cc - this forum closes in 5 days