You are here:--A BASIC INTRODUCTION TO NEXTION ARDUINO LIBRARY

A BASIC INTRODUCTION TO NEXTION ARDUINO LIBRARY

Introduction

Nextion Arduino library provides an easy-to-use method way to manipulate Nextion displays series. Users can use the library freely, either for commercial projects or for open-source projects, without any additional conditions.

There are ten examples in our library now. We will keep updating with more examples. Please visit our examples here.

Latest source code (master branch) can be downloaded here.
To discuss the project, request a new feature or report a BUG? please visit Nextion Forum.

Download Source Code

The latest version is unstable and a lot of changes may be applied in a short time interval without any notification to the users. Usually, this library is for developers only.
Release version is recommended for you, unless you are one of the developers of this library.
Find Release notes here.

Latest (unstable) version

You can also clone it via git:

git clone 

Release (stable) version

We provide two library formats in release version: the first one is the normal format while the second is suitable for developers.
♦ https://github.com/itead/ITEADLIB_Arduino_Nextion/archive/v0.7.0.zip
♦ https://github.com/itead/ITEADLIB_Arduino_Nextion/archive/v0.7.0.tar.gz

Find history releases versions here.

Supported Mainboards

All boards, which have one or more hardware serial, can be supported.
For example:
♦ Iteaduino MEGA2560
♦ Iteaduino UNO
♦ Arduino MEGA2560
♦ Arduino UNO

Configuration

In configuration file NexConfig.h, users can find two macros below:

♦ dbSerial: Debug Serial (baudrate:9600), needed by beginners to debug their nextion applications or sketches. If users complete their work, it will be a wise choice to disable Debug Serial.
♦ nexSerial: Nextion Serial, the bridge between Nextion and mainboard.

Note: the default configuration is for MEGA2560.

Redirect dbSerial and nexSerial

If users want to change the default serial to debug or communicate with Nextion, they need to modify the line in configuration file NexConfig.h

#define dbSerial Serial    ---> #define dbSerial Serialxxx
#define nexSerial Serial2  ---> #define nexSeria Serialxxx

Disable Debug Serial

If users want to disable the debug information, they need to modify the line in configuration file NexConfig.h:

#define DEBUG_SERIAL_ENABLE ---> //#define DEBUG_SERIAL_ENABLE

UNO-like Mainboards

If user’s board has only one hardware serial, such as UNO, they should disable dbSerial and redirect nexSerial to Serial (Refer to section: Serial configuration).

Example-Button

To help users quickly get started, we are now taking CompButton.ino as an example to show you how to to use the library. Users may download it and practice as we instruct.

First of all, open Com pButton in Examples. Users will see there are three files: HMI file, ino file and tft file.
1. Open and debug the CompButton. HMI in Nextion Editor, then click “upload”.
2. The tft.file is generated automatically by compiling the HMI file in Nextion Editor. Nextion also supports downloading project with tft file by SD card(within 2G).
3. Open CompButton.ino, copy all the source codes to Arduino IDE and download to your Arduino.

 

By | 2017-10-29T10:32:19+00:00 September 15th, 2017|Categories: Uncategorized|0 Comments

About the Author:

Leave A Comment