Unofficial Nextion/TJC User Forum

Nextion. What library to use?


I’m new to Nextion. As I’ve understood, there is quite a few libraries, but I can’t figure all out.

I’ve set up a simple layout with mostly dual state buttons. They will control relays.

At one point I actually got to change the output for one pin, but could not change it back.

Have tried different libraries and their examples, with obscure results. I need to start from scratch with some helpful hints from you.

I’m using a Arduino Mega, and 3.2" enhanced Nextion.

So where to start? With what library? Simple code example?

Did you tried Nextion original library ? Library

YouTube. There are LOTS of examples for how to get Arduinos and Nextion displays to talk.

Yes, I’ve tried three different including the original. Each with their own separate flaws and different ways of approach.

I was hoping some experienced user would have some directions or point me in the correct way to figure out my mentioned problem.

I don’t use Arduino AVR MCU. I wrote my own lib for the Microchip PIC MCUs. but its not stand alone yet.

What is the problem ? may be some video lessons of usage available on the Internet ?

I just searching Google 1-st link is :

Have you looked at the examples on the Nextion web site? Watched any YouTube videos? There are many out there and you should be able to figure it out pretty easily.

No need to use library, it’s quiet simple to code without any library !

Why do you need to use libraries?

On the MCU side it’s easy to send data to the HMI and to listen for it coming back, and just as easy for the HMI to send a string of data on a touch event.

1 Like

The Displays are good, but the Arduino library is total crap. Severeal lines of code are needed for just one button. The library hasn’t been updated for years. New Display functions like float ar not implemented therefore. Does anybody know a good alternative library? I tried to contact ITEAD, but that seems to be impossible to me. I had to create a account first wich was disabled immediately after creation. So a contact wasn’t possible. That company appears very weird to me.

Since the xfloat component is just a normal number field with additional attributes for the virtual decimal point, it should not be too difficult to duplicate and then extend the corresponding library object. BTW: In many real world applications (using other environments than Arduino, I admit), I prefer not using any library at all, the communication protocol with Nextion is so simple that it can be implemented on the fly.

This forum is in no way affiliated with NEXTION®, ITEAD STUDIO®, TJC®, or anyone else really. All product names, logos, and brands are property of their respective owners. All company, product, and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement from the respective rights holder(s).