Do me a favor... when you post. Put some space between the questions, or, some line breaks. Pretty hard to read you posts.
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.
What did you change it from? Did you think of printing the values of the GLCD_WIDTH and GLCD_HEIGHT prior to making the change? and, then do the same afterwards?
I set up the display in the editor for horizontal.
We will need to sort the parameters - so, this is practical. Let us resolve the setup first.
Why these line don't make circle? This may not be related to the setup.
Does the circle function work at all? Hard code some values and test.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So, the box draw code. Does this used glcd_height and glcd_width. If yes. do this box draw correctly. Test with just the box drawn. Does box 0,0,GLCD_WIDTH-1, GLCD_HEIGHT-1, TFT_YELLOW do what is expected?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Try the attached file. Different handler for your device.
If this fails. Send the GLCD to me, I promise to send back with other gifts when I have sorted the library.
@Chris.
The library does the string concat but for some reason, probably timing, this GLCD processor device is not handling the comms in the same manner. Also, probalby a clone GLCD processor!!
@Chris, Anobium sends the three ff bytes after print "cir " as press/hold ctrl and type 255 to get that asc chr$ and there's 3 char$(255)'s as in the nextion include.
I made ff,ff,ff a sub. It has confused picaxe users as there's a 14 page thread about nextion glcds.
cheers
@Anobium, Cheers, I test your nexTion3. It's been interesting looking at the new glcd and nextion includes.
I think it's a genuine nextion..printed box,labels etc. but what is real anymore?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried the nextion3 glcd and got a compiler error. -- please see screen image.
I used xpress board.
Here's the demo code I used. It is your demo..without gauges.
#chip 16f18855,32#option explicit#include <glcd.h>#define GLCD_TYPE GLCD_TYPE_NEXION320x480L#define NextionFont0 0, 8, 16 'Arial 8x16#define NextionFont1 1, 12, 24 '24point 12x24 charset#define NextionFont2 2, 16, 32 '32point 16x32 charset'Generated by PIC PPS Tool for Great Cow Basic'PPS Tool version: 0.0.5.11'PinManager data: v1.55''Template comment at the start of the config file'#startup InitPPS, 85SubInitPPS'Module: EUSARTRC0PPS=0x0010'TX > RC0TXPPS=0x0010'RC0 > TX (bi-directional)RC5PPS=0x0010'TX > RC5TXPPS=0x0015'RC5 > TX (bi-directional)EndSub'Template comment at the end of the config file#define USART_BAUD_RATE 9600#define USART_TX_BLOCKINGwait1sdemo:DimCCOUNT,BYTENUMBER,OLDFONT,OLDFONTasByteCCount=32dimlongNumberaslonglongNumber=0' max value = 4294967290dimwordNumberasWordwordNumber=0byteNumber=0wait1sGLCDCLSTFT_BLACKGLCDLocateString_Nexion1,1GLCDPrintDefaultFont_Nextion(NextionFont0)GLCDPrintString_Nexion("Great Cow BASIC ")GLCDLocateString_Nexion130,1GLCDPrintStringLn_Nexion("v0.98.02")GLCDPrint_Nexion(2,18,"DrawStr",TFT_YELLOW)GLCDPrint_Nexion(2,52,"Long:",TFT_WHITE)GLCDPrint_Nexion(2,70,"Word:")GLCDPrint_Nexion(2,88,"Byte:")GLCDPrint_Nexion(128,18,"Asc:"+" ")box0,0,GLCD_WIDTH-1,GLCD_HEIGHT-1,TFT_YELLOWboxGLCD_WIDTH-5,GLCD_HEIGHT-5,GLCD_WIDTH-1,GLCD_HEIGHT-1,TFT_WHITECircle(GLCD_WIDTH/2,GLCD_HEIGHT/2,50,TFT_WHITE);centerFilledCircle(GLCD_WIDTH/2,GLCD_HEIGHT/2,25,TFT_DARKGREY)line0,GLCD_HEIGHT-1,GLCD_WIDTH/2+100,(GLCD_HEIGHT/2)-50,TFT_CYANline0,(GLCD_HEIGHT/2)-50,GLCD_WIDTH/2+100,(GLCD_HEIGHT/2)-50,TFT_CYANfilledbox2,GLCD_HEIGHT/2+10,42,GLCD_HEIGHT/2+50,TFT_REDGLCDPrint_Nexion(70,GLCD_HEIGHT-36,"Great Cow BASIC",TFT_WHITE,NextionFont2)GLCDPrint_Nexion(GLCD_WIDTH-78,2,"Feb 2018",TFT_WHITE,NextionFont0)GLCDForeground=TFT_WHITEGLCDPrint_Nexion(100,GLCD_HEIGHT-60,"Nextion Driver",NextionFont1)DOforeverGLCDPrint_Nexion(64,52,longNumber,TFT_WHITE,NextionFont0)GLCDPrint_Nexion(124,52,longNumber,TFT_Yellow)'Change the colour via the global GLCD variableGLCDForeground=TFT_WHITEGLCDPrint_Nexion(184,52,longNumber)GLCDPrint_Nexion(64,70,pad(str(wordnumber),5))GLCDPrint_Nexion(64,88,pad(str(bytenumber),3))GLCDPrint_Nexion(101,19,chr(CCount))Box98,17,117,42,TFT_WHITE'Draw a box around the Char belowGLCDPrint_Nexion(180,18,pad(str(CCount),3))CCount++ifCCount=0thenCCount=32ifCCount=128thenCCount=32longNumber=longNumber+7wordNumber=wordNumber+3byteNumber++LOOP
I can send the device...but if a clone what point?
You have the enhanced version working so that is sorted for that display.
Will this be an issue for the other nextion displays in their range? IE sort 320x240 and other nextions don't work.
email your address again and I'll send with return stamps.
In the mean time I'll try to sort circle with one that works and try to fit in nextion include using different ways to send to experiment.
As I said...it can do circles....I think the problem is simple......a 5 minute job.
Optimism is contagious
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With the UNO the TX/RX pins are dedicated to programming, the xpress board does not, it used ICSPDAT and ICSPCLK lines.
The Nexion board serial lines could have software or pullups? to assure that they idle high, just like when the USB cable is attached for programming to the UNO. So I would expect conflicting signals when the UNO tries to pull the TX/RX lines low during programming.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do me a favor... when you post. Put some space between the questions, or, some line breaks. Pretty hard to read you posts.
What did you change it from? Did you think of printing the values of the GLCD_WIDTH and GLCD_HEIGHT prior to making the change? and, then do the same afterwards?
We will need to sort the parameters - so, this is practical. Let us resolve the setup first.
Does the circle function work at all? Hard code some values and test.
I tried this and glcd_height is 240 and glcd_width is 320.
It doesn't draw a circle.
I see where GLCDDeviceHeight and GLCDDeviceWidth are set in this code from glcd.h
Stan please answer the questions in the order they are provided. So confusing!
What was this originally in glcd.h?
glcd_type_string = "NEXION320x480L"
GLCD_WIDTH = 320
GLCD_HEIGHT = 240
NXN320x480L_GLCD_HEIGHT = GLCDDeviceHeight
NXN320x480L_GLCD_WIDTH = GLCDDeviceWidth
Is the code shown above the current setting?
What did this code print on the display?
FORGET THE CIRCLE FOR THE MOMENT! LET US GET THE SETUP CORRECT.
1- it was originally
glcd_type_string = "NEXION320x480L"
GLCD_WIDTH = 480
GLCD_HEIGHT = 320
NXN320x480L_GLCD_HEIGHT = GLCDDeviceHeight
NXN320x480L_GLCD_WIDTH = GLCDDeviceWidth
2- the current setting is
GLCD_WIDTH = 320
GLCD_HEIGHT = 240
line co-ordinates work as should.
3-
GLCDPrint_Nexion ( 0 , 0, str(glcd_height), TFT_WHITE, NextionFont1 ) -- prints 240
GLCDPrint_Nexion ( 0 , 32, str(glcd_width), TFT_WHITE, NextionFont1 ) -- prints 320
Ok.
So, the box draw code. Does this used glcd_height and glcd_width. If yes. do this box draw correctly. Test with just the box drawn. Does box 0,0,GLCD_WIDTH-1, GLCD_HEIGHT-1, TFT_YELLOW do what is expected?
ellipse doesn't work.
triangle and line and pset work as should.
text fonts 0,1,2 work as should.
this draws a circle
Stan. I asked! Does this box draw correctly. Test with just the box drawn. Does box 0,0,GLCD_WIDTH-1, GLCD_HEIGHT-1, TFT_YELLOW do what is expected?
You told me something else!
Does box work?
One day you will be able to do root cause analysis like me.
Yes box works to spec. as did
'line 0,0,319,0,TFT_YELLOW
'line 319,0,319,239,TFT_YELLOW
'line 0,0,0,239,TFT_YELLOW
'line 0,239,319,239,TFT_YELLOW
as I said screen co-ords ok
your box request was not visible when I last posted else I'd have tried it.
So, if box works. We know the parameter of the setup are valid and are being made correctly avaialable to main user program.
So, create a LITTLE program with JUST the circle draw command.
Post the code and attach the asm.
and, post me the code you USED for the BOX draw.
Here is the box and circle basic and asm.
I had a look at glcd and nextion include at xoffset and yoffset. nff
Last edit: stan cartwright 2018-03-23
Is this the same on both PIC and AVR?
The same demo looks different on xpress board.
This is your original with gauges commented out
and the ;demo code after that running.
But still no circle.
It's not a gcb circle but a nextion serprint "cir" with params.
have you rooted out the problem?
I use glyphosate.
From http://gcbasic.sourceforge.net/help/_serprint.html
SerPrint is used to send a value over the serial connection. value can be a string, integer, long, word or byte.
So you can send ONE value.
You may be able to concatenate a string and single parm:
~~~
SerPrint "cir" + Parm
~~~
But any more than that will probably be truncated. Microcontrollers are not great at string handling becouse of the memory restrictions.
Not tested, just my observation.
Cheers
Chris
@Stan.
Try the attached file. Different handler for your device.
If this fails. Send the GLCD to me, I promise to send back with other gifts when I have sorted the library.
@Chris.
The library does the string concat but for some reason, probably timing, this GLCD processor device is not handling the comms in the same manner. Also, probalby a clone GLCD processor!!
Last edit: Anobium 2018-03-24
@Chris, Anobium sends the three ff bytes after print "cir " as press/hold ctrl and type 255 to get that asc chr$ and there's 3 char$(255)'s as in the nextion include.
I made ff,ff,ff a sub. It has confused picaxe users as there's a 14 page thread about nextion glcds.
cheers
@Anobium, Cheers, I test your nexTion3. It's been interesting looking at the new glcd and nextion includes.
I think it's a genuine nextion..printed box,labels etc. but what is real anymore?
Amend last post-- Anobium now sends 255 thrice.
I tried the nextion3 glcd and got a compiler error. -- please see screen image.
I used xpress board.
Here's the demo code I used. It is your demo..without gauges.
Isolate this issue.
What does the that attachment on this post do?
I had a typo.
Stick with test code please.
No circle with
GLCDCLS TFT_BLACK
Circle (100,100,40,TFT_WHITE )
as above.
both in mega328p and xpress board.
I can send the device...but if a clone what point?
You have the enhanced version working so that is sorted for that display.
Will this be an issue for the other nextion displays in their range? IE sort 320x240 and other nextions don't work.
email your address again and I'll send with return stamps.
In the mean time I'll try to sort circle with one that works and try to fit in nextion include using different ways to send to experiment.
As I said...it can do circles....I think the problem is simple......a 5 minute job.
Optimism is contagious
Send through. I will examine the data stream and sort. We need to resolve for others that come this way in the future.
I have sent address via email to you.
ok.send monday
variable doesn't work for radius. numbers do
One point I mentioned.
Flashing on uno with nextion connected rx tx--give stk errors time out.
disconnecting rx tx and flash uno ok.
No problem with xpress board, display rx tx can be connected and flashes ok
a reason please..is it a com port thing?
With the UNO the TX/RX pins are dedicated to programming, the xpress board does not, it used ICSPDAT and ICSPCLK lines.
The Nexion board serial lines could have software or pullups? to assure that they idle high, just like when the USB cable is attached for programming to the UNO. So I would expect conflicting signals when the UNO tries to pull the TX/RX lines low during programming.