Table of Contents

Nextion HMI LCD



Nextion is a Seamless Human Machine Interface (HMI) solution that provides a control and visualisation interface between a human and a process, machine, application or appliance. Nextion is mainly applied to IoT or consumer electronics field. It is the best solution to replace the traditional LCD and LED Nixie tube.

We notice that most engineers spend much time in application development but get unpleasant results. In this situation, Itead offers you an excellent solution. This solution includes the hardware part - a series of TFT LCDs and the software part - Nextion editor. Nextion TFT LCDs use only one serial port to do communicating, which let you get rid of the wiring trouble. Nextion editor has mass components such as button, text, progress bar, slider, instrument panel etc. Simply drag and drop these components to the display window to compile, no need to spend much time and be annoyed by programming for these components any more. Now you can design your interface in 5-10 minutes, Nextion Editor reduces your 99% development workloads! With the help of this WYSIWYG editor, GUI designing is a piece of cake.

Nextion example project on Arduino UNO



Arduino UNO example code

Example code is not using arduino library for communication with Nextion LCD.

int value, value2, getValue, oldvalue;
 
void setup() {
  Serial.begin(9600);
}
 
void loop() {
  getValue = analogRead(A0);
  if (getValue==oldvalue)
  {
    //do nothing
  }
  else
 { 
   oldvalue=getValue;
   value=getValue;
   if(value <= 172) value2 = map(value, 0, 172, 315,359);
   else value2 = map(value, 172, 1023, 0,223);
 
  Serial.print("z0.val=");
  Serial.print(value2);
  Serial.write(0xff);
  Serial.write(0xff);
  Serial.write(0xff);
  Serial.print("t0.txt=");
  Serial.write(0x22);
  Serial.print(value);
  Serial.write(0x22);
  Serial.write(0xff);
  Serial.write(0xff);
  Serial.write(0xff);
 }
  delay(100);
}