Menu

Nexion Displays

Anobium
2018-02-18
2020-03-07
<< < 1 2 3 4 > >> (Page 3 of 4)
  • Anobium

    Anobium - 2018-03-23

    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.

     
  • stan cartwright

    stan cartwright - 2018-03-23

    I tried this and glcd_height is 240 and glcd_width is 320.
    It doesn't draw a circle.

    wait 1 s
    GLCDCLS TFT_BLACK
    GLCDPrint_Nexion ( 0 , 0, str(glcd_height), TFT_WHITE, NextionFont1 )
    GLCDPrint_Nexion ( 0 , 32, str(glcd_width), TFT_WHITE, NextionFont1 )
    
    Circle( GLCD_WIDTH/2, GLCD_HEIGHT/2, 50, TFT_WHITE )
    End
    

    I see where GLCDDeviceHeight and GLCDDeviceWidth are set in this code from glcd.h

         glcd_type_string = "NEXION320x480L"
         GLCD_WIDTH = 320
         GLCD_HEIGHT = 240
         NXN320x480L_GLCD_HEIGHT = GLCDDeviceHeight
         NXN320x480L_GLCD_WIDTH = GLCDDeviceWidth
    
     
  • Anobium

    Anobium - 2018-03-23

    Stan please answer the questions in the order they are provided. So confusing!

    1. 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

    2. Is the code shown above the current setting?

    3. What did this code print on the display?

    GLCDPrint_Nexion ( 0 , 0, str(glcd_height), TFT_WHITE, NextionFont1 )
    GLCDPrint_Nexion ( 0 , 32, str(glcd_width), TFT_WHITE, NextionFont1 )
    

    FORGET THE CIRCLE FOR THE MOMENT! LET US GET THE SETUP CORRECT.

     
  • stan cartwright

    stan cartwright - 2018-03-23

    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

     
  • Anobium

    Anobium - 2018-03-23

    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?

     
  • stan cartwright

    stan cartwright - 2018-03-23

    ellipse doesn't work.

    triangle and line and pset work as should.

    text fonts 0,1,2 work as should.

     
  • stan cartwright

    stan cartwright - 2018-03-23

    this draws a circle

    HSerPrint "cir 100, 100, 30, WHITE"
    repeat 3
      HSersend (255) ; ff,ff,ff end of command line
    end repeat
    
     
  • Anobium

    Anobium - 2018-03-23

    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.

     
  • stan cartwright

    stan cartwright - 2018-03-23

    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.

     
    • Anobium

      Anobium - 2018-03-23

      So, if box works. We know the parameter of the setup are valid and are being made correctly avaialable to main user program.

       
      • Anobium

        Anobium - 2018-03-23

        So, create a LITTLE program with JUST the circle draw command.
        Post the code and attach the asm.

         
  • Anobium

    Anobium - 2018-03-23

    and, post me the code you USED for the BOX draw.

     
  • stan cartwright

    stan cartwright - 2018-03-23

    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
  • Anobium

    Anobium - 2018-03-23

    Is this the same on both PIC and AVR?

     
  • stan cartwright

    stan cartwright - 2018-03-23

    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.

     
    • Chris Roper

      Chris Roper - 2018-03-24

      It's not a gcb circle but a nextion serprint "cir" with params.

      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

       
  • Anobium

    Anobium - 2018-03-24

    @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
  • stan cartwright

    stan cartwright - 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?

     
  • stan cartwright

    stan cartwright - 2018-03-24

    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.

        #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, 85
    
        Sub InitPPS
    
                'Module: EUSART
                RC0PPS = 0x0010    'TX > RC0
                TXPPS = 0x0010    'RC0 > TX (bi-directional)
                RC5PPS = 0x0010    'TX > RC5
                TXPPS = 0x0015    'RC5 > TX (bi-directional)
    
        End Sub
        'Template comment at the end of the config file
    
        #define USART_BAUD_RATE 9600
        #define USART_TX_BLOCKING
    
        wait 1 s
    demo:
        Dim CCOUNT, BYTENUMBER, OLDFONT, OLDFONT as Byte
    
        CCount = 32
        dim longNumber as long
        longNumber = 0 ' max value = 4294967290
        dim wordNumber as Word
        wordNumber = 0
        byteNumber = 0
    
        wait 1 s
        GLCDCLS TFT_BLACK
    
        GLCDLocateString_Nexion 1,1
        GLCDPrintDefaultFont_Nextion ( NextionFont0 )
        GLCDPrintString_Nexion ( "Great Cow BASIC " )
        GLCDLocateString_Nexion 130,1
        GLCDPrintStringLn_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:"+"  " )
    
        box 0,0,GLCD_WIDTH-1, GLCD_HEIGHT-1, TFT_YELLOW
        box GLCD_WIDTH-5, GLCD_HEIGHT-5,GLCD_WIDTH-1, GLCD_HEIGHT-1, TFT_WHITE
    
        Circle( GLCD_WIDTH/2, GLCD_HEIGHT/2, 50, TFT_WHITE )            ;center
        FilledCircle( GLCD_WIDTH/2, GLCD_HEIGHT/2, 25, TFT_DARKGREY  )
    
        line 0,  GLCD_HEIGHT-1 , GLCD_WIDTH/2 +100,  (GLCD_HEIGHT /2) - 50, TFT_CYAN
        line  0, (GLCD_HEIGHT /2) - 50, GLCD_WIDTH/2 +100, (GLCD_HEIGHT /2) - 50, TFT_CYAN
    
        filledbox 2,GLCD_HEIGHT/2+10,42,GLCD_HEIGHT/2+50, TFT_RED
    
        GLCDPrint_Nexion ( 70, GLCD_HEIGHT - 36 , "Great Cow BASIC" , TFT_WHITE, NextionFont2 )
    
    
        GLCDPrint_Nexion ( GLCD_WIDTH - 78, 2 , "Feb 2018" , TFT_WHITE, NextionFont0 )
    
        GLCDForeground = TFT_WHITE
        GLCDPrint_Nexion ( 100 , GLCD_HEIGHT - 60 , "Nextion Driver", NextionFont1 )
    
        DO forever
    
          GLCDPrint_Nexion ( 64 , 52, longNumber, TFT_WHITE, NextionFont0 )
          GLCDPrint_Nexion ( 124 , 52, longNumber, TFT_Yellow )
    
          'Change the colour via the global GLCD variable
          GLCDForeground = TFT_WHITE
          GLCDPrint_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) )
          Box 98,17,117,42, TFT_WHITE                                   'Draw a box around the Char below
    
          GLCDPrint_Nexion ( 180, 18 , pad( str(CCount),3) )
          CCount++
          if CCount = 0 then CCount = 32
          if CCount = 128 then CCount = 32
          longNumber = longNumber + 7
          wordNumber = wordNumber + 3
          byteNumber++
    
        LOOP
    
     
  • Anobium

    Anobium - 2018-03-24

    Isolate this issue.

    What does the that attachment on this post do?

    I had a typo.

    Stick with test code please.

    #chip mega328p,16
    #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
    
    
    #define USART_BAUD_RATE 9600
    #define USART_TX_BLOCKING
    
    wait 1 s
    GLCDCLS TFT_BLACK
    
    Circle (100,100,40,TFT_WHITE )
    End
    
     
  • stan cartwright

    stan cartwright - 2018-03-24

    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

     
    • Anobium

      Anobium - 2018-03-24

      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.

       
  • stan cartwright

    stan cartwright - 2018-03-24

    ok.send monday
    variable doesn't work for radius. numbers do

    HSerPrint "cir 100, 100, radius, WHITE" ;don't work
    repeat 3
      HSersend (255) ; ff,ff,ff end of command line
    end repeat
    
     
  • stan cartwright

    stan cartwright - 2018-03-24

    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?

     
    • kent_twt4

      kent_twt4 - 2018-03-24

      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.

       
<< < 1 2 3 4 > >> (Page 3 of 4)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.