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.
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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
See an example Youtube video at https://www.youtube.com/watch?v=8ojtbW2cNKg
An example command set:
Last edit: 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.
When adding a new font set you must add the following to add the additional font method:
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