Menu

Color GLCD display driver - ST7735 devices

Anobium
2014-10-20
2014-10-20
  • Anobium

    Anobium - 2014-10-20

    Just released an updated Color GLCD display driver using the ST7735 controller.

    The GLCD.h driver for the TFT ST7735 is a 1.8 inch display with 128 * 160 Color pixels. The command set is the standard GLCD command set with color. See code below and the attachment for an example.

    Hugh developed the core of this release a while ago this provide compatibility and a host of new commands to allow the fullest of control of the display.

    Have fun,

    Anobium

     

    Last edit: Anobium 2014-10-20
  • Anobium

    Anobium - 2014-10-20

    New commands for this device.

    ~~~~
    - ST7735Rotation ( LANDSCAPE | PORTRAIT | LANDSCAPE_REV | PORTRAIT_REV )
    - Color definitions

    ST7735_BLACK 0x0000
    ST7735_BLUE 0xF800
    ST7735_RED 0x001F
    ST7735_GREEN 0x07E0
    ST7735_CYAN 0xFFE0
    ST7735_MAGENTA 0xF81F
    ST7735_YELLOW 0x07FF
    ST7735_WHITE 0xFFFF
    - You define you own colors....
    - A host of controller commands two examples are
    - ST7735SendCommand(ST7735_DISPOFF)
    - ST7735SendCommand(ST7735_DISPON)
    ~~~~~

    The rest of the commands are the same as the standard GLCD with the COLOR parameter rather this FOREGROUND | BACKGROUND

     

    Last edit: Anobium 2014-10-20
  • Anobium

    Anobium - 2014-10-20

    See an example Youtube video at https://www.youtube.com/watch?v=8ojtbW2cNKg

     
  • Anobium

    Anobium - 2014-10-20

    An example command set:

      circle(10,10,10, ST7735_BLACK                 ;upper left
      filledcircle(117,10,10, ST7735_BLUE)          ;upper right
      filledcircle(63,31,10, ST7735_RED)            ;center
      filledcircle(63,31,20, ST7735_GREEN)          ;center
      filledcircle(10,53,10, ST7735_CYAN)           ;lower left
      filledcircle(117,53,10, ST7735_MAGENTA)       ;lower right
      FilledBox(0,0,159,127, ST7735_YELLOW)
      Box(0,0,30,30, ST7735_RED )
      line 79,63, 79+xx, 63+yy, ST7735_CYAN
    
     

    Last edit: Anobium 2014-10-20
  • Anobium

    Anobium - 2014-10-20

    Using additional fonts. I recently added additional fonts as an option to GCB. The example file attached, see https://sourceforge.net/p/gcbasic/discussion/629990/thread/ba139c2e/50fd/attachment/TFT%20Display%20001.gcb using two fonts. Remember - many more fonts can be defined.... table space is the limitation.

    Example usage. Note the internal GCB font define GLCDfntDefault as 0. Therefore GLCDfntDefault = 0 is already defined.

      GLCDfntDefault = 1                 ; change to alternative font #1
      GLCDBackground = ST7735_YELLOW     ; select Yellow
      GLCDDrawString(0,120,str(1)+"TestString")    ; print string using font #1
    
      GLCDfntDefault = 0                ;  revert to GCB font
      GLCDBackground = ST7735_GREEN     ; use Green
      GLCDDrawString(80,119,str(0)+"TestString")    ; print a string.
    

    When adding a new font set you must add the following to add the additional font method:

     #define GLCDDrawChar AltGLCDDrawChar
    

    Then, you MUST add the AltGLCDDrawChar method and the five tables per font. AltGLCDDrawChar shows the method to add more fonts.

     

    Last edit: Anobium 2014-10-20

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.