How to use a Nextion display and Great Cow BASIC with Nextion displays.
How to use the Great Cow BASIC language with Nextion diskplays with Microchip PICs and AVRs 8bit microcontrollers including the Arduino range microcontrollers, with a common approach with a cross microcontroller solution.
The solution you will create will show you.
How the Nextion display responds to Nextion Button Component release event to send instructions the microcontroller and the microcontroller will instruct the Nextion display to change page(s)
How the Nextion display on-screen Button Component press/release event send instructions to the microcontroller to control an LED
How the microcontroller update status Text Component on the Nextion display
How the microcontroller increments a variable and updates a Number Component on the Nextion display
How the Nextion display evaluates and update color status of a Text Component based on value of another Number Component
The Nextion screen when created, following the instructions below, look like this.
When the Nextion display is operation you can be able to control an LED attached to the microcontroller (via a suitable resisitor) and the microcontroller will update the Nextion display.
So, enjoy this tutorial and thank you to Patrick of Nextion for the inspiration.
I thought using the nextion ide a pain but you have to set up the device.
Not ideal.
The idea is the display does the work not the controller.
I havem't used my nextion for a while but seem to remember it was
print "draw x,y" or print "window x"
Your demo was very interesting but seemed complicated to me.
It must be simpler to get a button touch as pressed to work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The purpose of the tutorial is to reduce the learning curve of the Nextion editor, as this is a step by step walk through.
This is an PIC and AVR integration tutorial. A standalone Nextion with no integration is a tad pointless.
But, I was asked to produce this by Nextion to show a non Arduino solution.
There is a Great Cow BASIC Nextion library. That Great Cow BASIC library supports a lot of the standard GLCD commands like GLCDCLS, BOX, LINE etc. But, of course , you can use the Nextion editor and the Nextion instruction language to achieve similar outcomes.
Regarding complexity.... the tutorial shows you how a push button component can interface with a microcontroller and how to create a closed loop feedback loop back to the Nextion.... rather than a Nextion push button component that hopes the microcontroller sets port (LED) status.
The code provided is also a scalable solution. Which means a user can build a robust Nextion solution with the implementation of a serial buffer ring, closed loop communications and the confidence that the solution works across a large range of 8-bit microcontrollers.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This step by step tutorial will show you:
The solution you will create will show you.
The Nextion screen when created, following the instructions below, look like this.
When the Nextion display is operation you can be able to control an LED attached to the microcontroller (via a suitable resisitor) and the microcontroller will update the Nextion display.
So, enjoy this tutorial and thank you to Patrick of Nextion for the inspiration.
Evan
Last edit: Anobium 2019-11-21
A HTML rendered version of the PDF is here.
http://htmlpreview.github.io/?https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources/blob/master/GLCD_Solutions/GLCD_Nextion_Solutions/tutorial/Nextion.html
I thought using the nextion ide a pain but you have to set up the device.
Not ideal.
The idea is the display does the work not the controller.
I havem't used my nextion for a while but seem to remember it was
print "draw x,y" or print "window x"
Your demo was very interesting but seemed complicated to me.
It must be simpler to get a button touch as pressed to work.
The purpose of the tutorial is to reduce the learning curve of the Nextion editor, as this is a step by step walk through.
This is an PIC and AVR integration tutorial. A standalone Nextion with no integration is a tad pointless.
But, I was asked to produce this by Nextion to show a non Arduino solution.
There is a Great Cow BASIC Nextion library. That Great Cow BASIC library supports a lot of the standard GLCD commands like GLCDCLS, BOX, LINE etc. But, of course , you can use the Nextion editor and the Nextion instruction language to achieve similar outcomes.
Regarding complexity.... the tutorial shows you how a push button component can interface with a microcontroller and how to create a closed loop feedback loop back to the Nextion.... rather than a Nextion push button component that hopes the microcontroller sets port (LED) status.
The code provided is also a scalable solution. Which means a user can build a robust Nextion solution with the implementation of a serial buffer ring, closed loop communications and the confidence that the solution works across a large range of 8-bit microcontrollers.
I will try using my nextion again. I just thought your code was unfamiiar...and uses an interrupt.
I've forgotten how the nextion editor works.
Stan. It is a tutorial. The editing process is detailed. Read the tutorial first... it will help.