In previous instructables (1, 2, 3) we looked at how to send data from the Nextion to your Arduino Uno. We did this without using the libraries. Now I'd like to show you how you can send commands from the Arduino to a Nextion screen without the libraries. You can write almost any command that we find in the instruction set to the Nextion from the Arduino.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Make Your Interface
For this instructable you can just download the interface. There is no code anywhere in the interface. It is much simpler than the previous instructables.
Step 2: Connect Your Components
Refer to the picture and connect your Nextion to the Arduino. You should also connect the circuit.
The idea of this circuit is just to have 2 resistors with different values connected in series. In series resistors are voltage dividers. We can measure the different voltages over the resistors and output that reading to the screen. You can also measure ground and +5V to see if they are indeed read as 0 and 1023 by the Arduino.
EDIT: In the past I connected the Nextion to a digital pin for power, but this is not recommended. If possible rather power your Nextion from the 5V pin on the Arduino or an external 5V power supply.
Step 3: Upload the Arduino Sketch
Download the sketch and upload it to your board. I tried to add enough comments to the sketch to make it understandable.
Step 4: Test
Play around with your A0 pin's jumper and read different voltages across the circuit. The value on the screen should change accordingly.
sdtag made it!