I spent an hour trying to see how out the box nextion can be used with microcontroller and no wiser than when I used with picaxe. Do I program a blank project then flash sdcard and put in nextion and power? I know it's wrong to ask nextion questions here but if others get one then same problems as me.
I can't find a way to get out the installed demo and make a blank display that can be prorammed with serprint commands and data. The last nextion I had was the same and I erased the demo but forgot how..and never got it working.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Commands like GLCDPrint_Nexion will be in next release.
Out the box the display has been programmed with the demo.
I think I download a blank project from the nextion editor then load it to sd card with say win32 disk imager then insert sd card in display an power on and it programs the device.
The use the device with microcontroller when the device has already been programmed is not easy to find on google.
This is my second nextion and both came programmed with the same demo.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't think it's easy to use. Did your nextion have a demo running when powered?
How to make it a blank display on power on and ready to accept hserprint commands which do nothing in demo mode. You got to reprogram the device some way. sd card is one method, think can be serial to.
Last edit: stan cartwright 2018-03-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried using a usb to serial converter with the nextion and the ilead gui and it works.
TX to TX. RX to RX
On arduino it's tx to rx and rx to tx.
I tried this code and cls colour works but not line or print. So some joy.
I programmed it with just screen 0 and a font .zi file.
Strange if I flash the uno with it connected to the display, I get stk errors but if I flash the uno with the display not connected it flashes ok. I connect the display and the screen changes colour.
#chip mega328p, 16
#option Explicit
#define USART_BAUD_RATE 9600
#define USART_BLOCKING
wait 10 ms
HSerPrint "cls RED"
ff
HSerPrint "draw 0, 0, 100, 100, RED"
ff
HSerPrint "cir 100, 100, 30, WHITE"
ff
HSerPrint "print ""123"""
ff
end
;
sub ff
repeat 3
HSersend (255) ; ff,ff,ff end of command line
end repeat
wait 5 ms
end sub
Last edit: stan cartwright 2018-03-20
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This automatically detects if you are using hardware or software serial. The default is hardware serial. You can change the serial command also by adding this to your user code.
A few special functions are included - the demo shows the usage.
'update Nextion display object with a long number
GLCDUpdateObject_Nexion ( in nextionobject as string , in nextionnumberData as long )
'update Nextion display object with an integer
GLCDUpdateObject_Nexion ( in nextionobject as string , in nextionnumberData as integer )
'send a Op Instruction Nextion display object with a string Like select a page...
GLCDSendOpInstruction_Nexion ( in nextionobject as string , in nextionstringData as string )
Thank you. I'll test it with my smaller display.
I thought the original thread was using nextion with gcb not an include.
I actually wanted to use the nextion commands from gcb as the synatax is odd a bit. Just to.
The error flashing uno with display tx/rx connected has got me. same com port?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I used the new glcd,the nextion include .It needed ssd1331 and hx8347 to compile the Nextion Test for xplorer board and just a blank display.
The following I expected rx and tx. Again unfamiliar.
The xpress board demo did nothing as did changing to mega328p'
This does nothing either. not even cls black
I know the display does that and box and circle so must be wired ok and working. It's the smallest display nextion do.
Using the nextion command HSerPrint "cir 100,100,30,WHITE" it doesn't work with variables like
HSerPrint "cir 100,100,variable,WHITE"
Sorry not positive feedback. Not much other either. Not popular displays with gcb users maybe.
Must be supported in gcb though as it seems to be popular..look at youtube.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I reset the nextion to 9600 baud. Xpress board nextion test still not working.
Are you assuming I have installed a gauge and nextion fonts in the ilead ide? because I haven't. Is that the problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
GOOD NEWS...ish. I downloaded the original demo everyone gets out the box and progged it and it worked as it did. Then tried the xpress board demo and IT WORKED! Nice one Anobiwan.
Lots to learn with these nextions. Thanks for your patience.
ps I like stan wars
Last edit: stan cartwright 2018-03-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ish ...cut and paste is not understanding. I got the idea you can't use what you haven't installed in the project. Items have id and properties. Takes a while to use.
Your demo works with avr after a few changes.
Can you take the demo and create a few demos - at the moment the file has a copy of demos and this is not not that clear.
May be one for guages, one for glcd test and for the PIC and AVR.
Can you put the standard demo header on the files then I can post to GitHub.
Ta,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi again. a bit of experimenting and seems to use nextion then in the ide create fonts and save and click install in project or sending text wont work. Sort device then display. like glcd landscape or portrait. Then compile, then update. this works faster using a usb-ttl adapter.
Ok, now your demo has a glcd demo which works...a bit.
I commented out gauges. No circle cos screen size?
Circle( GLCD_WIDTH/2, GLCD_HEIGHT/2, 50, TFT_WHITE ) ;center
FilledCircle( GLCD_WIDTH/2, GLCD_HEIGHT/2, 25, TFT_DARKGREY )
where is the circle error?
You have nextion320x480 and it implies for one model only not general nextion
That looks very different. Where have all the strings gone?
What are the dimensions of your new display? I think we can add an adaption to easily handle the different screen sizes, so, you do not have to fiddled with the glcd.h
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I changed If GLCD_TYPE = GLCD_TYPE_NEXION320x480L Then in GLCD.h lines GLCD_WIDTH = 320, GLCD_HEIGHT = 240 as I'm using Nextion NX3224T024 320x240 STANDARD, NOT ENHANCED if that matters. I set up the display in the editor for horizontal.
Why these line don't make circle?
Circle( GLCD_WIDTH/2, GLCD_HEIGHT/2, 50, TFT_WHITE ) ;center
FilledCircle( GLCD_WIDTH/2, GLCD_HEIGHT/2, 25, TFT_DARKGREY )
I spent an hour trying to see how out the box nextion can be used with microcontroller and no wiser than when I used with picaxe. Do I program a blank project then flash sdcard and put in nextion and power? I know it's wrong to ask nextion questions here but if others get one then same problems as me.
I can't find a way to get out the installed demo and make a blank display that can be prorammed with serprint commands and data. The last nextion I had was the same and I erased the demo but forgot how..and never got it working.
Did you see https://sourceforge.net/p/gcbasic/discussion/629990/thread/29947f7d/#42b4/79d7 ?
I need to get the release completed.
Commands like GLCDPrint_Nexion will be in next release.
Out the box the display has been programmed with the demo.
I think I download a blank project from the nextion editor then load it to sd card with say win32 disk imager then insert sd card in display an power on and it programs the device.
The use the device with microcontroller when the device has already been programmed is not easy to find on google.
This is my second nextion and both came programmed with the same demo.
Just start. with the. Help. You do not need Win32 disk imager. Just read the Help from the Nextion Editor. This is really easy to use.
I don't think it's easy to use. Did your nextion have a demo running when powered?
How to make it a blank display on power on and ready to accept hserprint commands which do nothing in demo mode. You got to reprogram the device some way. sd card is one method, think can be serial to.
Last edit: stan cartwright 2018-03-18
I tried using a usb to serial converter with the nextion and the ilead gui and it works.
TX to TX. RX to RX
On arduino it's tx to rx and rx to tx.
I tried this code and cls colour works but not line or print. So some joy.
I programmed it with just screen 0 and a font .zi file.
Strange if I flash the uno with it connected to the display, I get stk errors but if I flash the uno with the display not connected it flashes ok. I connect the display and the screen changes colour.
Last edit: stan cartwright 2018-03-20
I got a line and circle by removing spaces
Now to sort print..getting there
I got a line and circle by removing spaces
Now to sort print..getting there
Here you go - the library and a demo. This will work with your release.
Demo is attached - get the lastest glcd.h and the new GLCD_NEXION320x480L.h Put in the correct place. Shows how to do everything. Get from https://sourceforge.net/p/gcbasic/code/HEAD/tree/GCBASIC/trunk/include/
See the attachment for the demo - it is very easy to use.
Setup serial, then define the fonts if you wan to use Nextion Fonts - and, you do!
This automatically detects if you are using hardware or software serial. The default is hardware serial. You can change the serial command also by adding this to your user code.
hardware serial
if you use software serial - a valid serial command is required.
A few special functions are included - the demo shows the usage.
'update Nextion display object with a long number
GLCDUpdateObject_Nexion ( in nextionobject as string , in nextionnumberData as long )
'update Nextion display object with an integer
GLCDUpdateObject_Nexion ( in nextionobject as string , in nextionnumberData as integer )
'send a Op Instruction Nextion display object with a string Like select a page...
GLCDSendOpInstruction_Nexion ( in nextionobject as string , in nextionstringData as string )
Thank you. I'll test it with my smaller display.
I thought the original thread was using nextion with gcb not an include.
I actually wanted to use the nextion commands from gcb as the synatax is odd a bit. Just to.
The error flashing uno with display tx/rx connected has got me. same com port?
I used the new glcd,the nextion include .It needed ssd1331 and hx8347 to compile the Nextion Test for xplorer board and just a blank display.
The following I expected rx and tx. Again unfamiliar.
I'll try glcd commands next.
Just cable it up and try the demo. Then, examine. The PPS is already setup for the Xpress board you are using a
xplorer board
?The xpress board demo did nothing as did changing to mega328p'
This does nothing either. not even cls black
I know the display does that and box and circle so must be wired ok and working. It's the smallest display nextion do.
Using the nextion command HSerPrint "cir 100,100,30,WHITE" it doesn't work with variables like
HSerPrint "cir 100,100,variable,WHITE"
Sorry not positive feedback. Not much other either. Not popular displays with gcb users maybe.
Must be supported in gcb though as it seems to be popular..look at youtube.
If you put bauds=115200 in the ilead ide event window you can use #define USART_BAUD_RATE 115200. Works. Should be fast if I get stuff working.
Last edit: stan cartwright 2018-03-21
@Stan. Stop guessing. I know the library works. Read the Help for the Nextion.
Reset the device. Connect the Xpress Board and it will work with the demo, then, fiddle.
If you change the comm to115k you will break the Nextion support for interrups/touch display. So, do not do this.
I reset the nextion to 9600 baud. Xpress board nextion test still not working.
Are you assuming I have installed a gauge and nextion fonts in the ilead ide? because I haven't. Is that the problem?
No idea. Really.
Load the default Nextion demo to start with from the Nextion IDE. Then, test.
GOOD NEWS...ish. I downloaded the original demo everyone gets out the box and progged it and it worked as it did. Then tried the xpress board demo and IT WORKED! Nice one Anobiwan.
Lots to learn with these nextions. Thanks for your patience.
ps I like stan wars
Last edit: stan cartwright 2018-03-21
Tell me the 'ish' issue
Now figure out how it all works.
Ish ...cut and paste is not understanding. I got the idea you can't use what you haven't installed in the project. Items have id and properties. Takes a while to use.
Your demo works with avr after a few changes.
OK.
Pay back time now....
Can you take the demo and create a few demos - at the moment the file has a copy of demos and this is not not that clear.
May be one for guages, one for glcd test and for the PIC and AVR.
Can you put the standard demo header on the files then I can post to GitHub.
Ta,
Hi again. a bit of experimenting and seems to use nextion then in the ide create fonts and save and click install in project or sending text wont work. Sort device then display. like glcd landscape or portrait. Then compile, then update. this works faster using a usb-ttl adapter.
Ok, now your demo has a glcd demo which works...a bit.
I commented out gauges. No circle cos screen size?
Circle( GLCD_WIDTH/2, GLCD_HEIGHT/2, 50, TFT_WHITE ) ;center
FilledCircle( GLCD_WIDTH/2, GLCD_HEIGHT/2, 25, TFT_DARKGREY )
where is the circle error?
You have nextion320x480 and it implies for one model only not general nextion
Last edit: stan cartwright 2018-03-23
That looks very different. Where have all the strings gone?
What are the dimensions of your new display? I think we can add an adaption to easily handle the different screen sizes, so, you do not have to fiddled with the glcd.h
I changed If GLCD_TYPE = GLCD_TYPE_NEXION320x480L Then in GLCD.h lines GLCD_WIDTH = 320, GLCD_HEIGHT = 240 as I'm using Nextion NX3224T024 320x240 STANDARD, NOT ENHANCED if that matters. I set up the display in the editor for horizontal.
Why these line don't make circle?
Circle( GLCD_WIDTH/2, GLCD_HEIGHT/2, 50, TFT_WHITE ) ;center
FilledCircle( GLCD_WIDTH/2, GLCD_HEIGHT/2, 25, TFT_DARKGREY )