Skip to content
Enhanced Nextion library for Arduino, NodeMcu, Esp8266,...
HTML TeX C++ PostScript JavaScript CSS Other
Branch: master
Clone or download
Pull request Compare This branch is 23 commits ahead of itead:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
examples Small changes in examples Feb 27, 2019
html
latex
NexButton.cpp Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexButton.h Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexCheckbox.cpp Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexCheckbox.h Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexConfig.h C++ STD library usage changed optional Mar 20, 2019
NexCrop.cpp Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexCrop.h
NexDualStateButton.cpp Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexDualStateButton.h Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexGauge.cpp
NexGauge.h
NexGpio.cpp add gpio and rtc function Nov 28, 2016
NexGpio.h
NexHardware.cpp updated to latest nextion return/error code documentation Aug 14, 2019
NexHardware.h updated to latest nextion return/error code documentation Aug 14, 2019
NexHotspot.cpp
NexHotspot.h Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexNumber.cpp
NexNumber.h
NexObject.cpp Waveform corrections & NexObject enhancement Mar 4, 2019
NexObject.h Waveform corrections & NexObject enhancement Mar 4, 2019
NexPage.cpp
NexPage.h
NexPicture.cpp
NexPicture.h Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexProgressBar.cpp Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexProgressBar.h Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexRadio.cpp Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexRadio.h Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexRtc.cpp Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexRtc.h updated to latest nextion return/error code documentation Aug 14, 2019
NexScrolltext.cpp Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexScrolltext.h Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexSlider.cpp Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexSlider.h Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexText.cpp Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexText.h
NexTimer.cpp
NexTimer.h
NexTouch.cpp Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexTouch.h
NexUpload.cpp
NexUpload.h updata class index Oct 10, 2016
NexVariable.cpp Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexVariable.h Enhanced and corrected Nextion library version for Arduino/Esp8266/No… Feb 25, 2019
NexWaveform.cpp C++ STD library usage changed optional Mar 20, 2019
NexWaveform.h communication stability bug corrections Jun 12, 2019
Nextion.h
doxygen.doxy
doxygen.h add note for arduino example Aug 24, 2015
license.md
readme.md
release_notes.md updated to latest nextion return/error code documentation Aug 14, 2019
version.txt

readme.md

@mainpage Home Page

Enhanced Nextion Library


Jyrki Berg 8/14/2019 (https://github.com/jyberg)

-Backward compatinility issue: - systemStartUpCallback function pointer name corrected to match Nextion functionality/documentation new name: nextionReadyCallback

  • Error code list updated (NexHardware.cpp)
  • nextionStartupCallback function added. Called when when Nextion has started or reset

Jyrki Berg 2/17/2019 Enhanced and corrected Nextion library version for Arduino/Esp8266/NodeMcu, based on original Nextion Arduino library.

  • Added support for NodeMcu/esp8266, Software serial, Software serial can be used with arduino
  • Added support to define communication baud rate in nexInit functiono
  • Added support for global Nextion objects. (Optional page parameter added in the components)
  • NexVariable corrected to use int32_t data type
  • NextText corrected to return tru/false, and string length is returned in len parameter
  • NextText String object support added
  • other small bug fixes done
  • Added to support global Nextion events like CurrentPageIdCallback,systemStartUpCallback,... see NexHardware.h
  • Waveform corrections:
    • Inheritance to support toutch events
    • return values corrected
    • set/get channel colour corrected to support all channels
  • Waveform enhancedments:
    • Suport scaled values:
    • define min and max values + coponent height in pixels (component support 255 pixel max height). When value is added to changell it is automatically scaled to component size and min/max value definitions.
    • Add multiple values to line
    • Clear component
  • Added get component height/width function calls to NexObject
  • examples Nextion editor projects corrected
  • C++ std library usage made optional, (e.g std::vector) See NexConfig.h #define STD_SUPPORT
  • C style versions added for functions that uses std::vector etc..

Nextion serial instruction set see: https://www.itead.cc/wiki/Nextion_Instruction_Set or https://nextion.itead.cc/resources/documents/instruction-set/

-For some reason I need to remove NexUpload.h & NexUpload.cpp when using the library in PlatformIO some platform header files not found spontaneously when building, adding the libray path in platformio.ini did not help.

Introduction

Nextion Arduino library provides an easy-to-use way to manipulate Nextion serial
displays. Users can use the libarry freely, either in commerical projects or
open-source prjects, without any additional condiitons.

Nextion easy to use UI Editor: https://nextion.itead.cc/resources/download/nextion-editor/
Enhanced easy to use Nextion Font Editor: https://github.com/hagronnestad/nextion-font-editor

For more information about the Nextion display project, please visit
the wiki。

Suppported Mainboards

All boards, which has one or more hardware serial, can be supported.

For example:

  • Iteaduino MEGA2560
  • Iteaduino UNO
  • Arduino MEGA2560
  • Arduino UNO
  • NodeMcu
  • Esp8266

Configuration

In configuration file NexConfig.h, you can configure Hardware / software, debug serial usage

In case of Hardware serial comment/undefine "// #define NEX_SOFTWARE_SERIAL" line and
configure used Serial port on line "#define nexSerial Serial"
by default Serial poirt used (NodeMcu/Esp8266 hardware serial)

Software serial used if "#define NEX_SOFTWARE_SERIAL" when NEX_SOFTWARE_SERIAL is defined
use NEX_RX and NEX_TX definitions to define used software serial ports.
By default NodeMcu:
"#define NEX_RX D2"
"#define NEX_TX D1"
NodeMcu board pin numbers not match with Esp8266 pin numbers. So use D pin number definitions from pins_arduino.h
You need to remember that Software serial is not nessessary workin with out problmes at least when using NodeMcu/Esp8266 boards (See power tips...).

If you want activate Debug messages, uncomment "//#define DEBUG_SERIAL_ENABLE" line and define serial port used for debug messges using line:
"//#define dbSerial Serial", it is responsibiity of main program to initialize/open debug serial port.

Power tips

Nextion and NodeMcu/Esp8266 is sensitive with power quality and current. Especially when Software serial is used, (Serial message quality can be bad and then functionality is not stable...). Don't power Nextion display from NodeMcu board, because Nextion takes guite mutch of current, and NodeMcu internal power requlator is not good. Use separate power to power Nextion and connect Nextion and NodeMcu/Esp8266 board gnd to commond gnd point.

Useful Links

You can’t perform that action at this time.