Go Down

Topic: New library for ST7735 displays and the "Minions" TFT on eBay (Read 8349 times) previous topic - next topic

Bwanna

Thanks for responding.  I didn't realize and agree... best to stick with the well used method. 

Would you mind an additional question?

The TFT library also has a text(string,x,y) function.  This seems to combine the Arduino setCursor() and print() functions. I'm starting to redo this to accommodate, but wanted to make sure that didn't miss something and could stay with my original code.

Thanks!
Steve

david_prentice

You just have to think about the best way to proceed:
Either continue with TFT.h
Or use an Adafruit_GFX.h style library

If you are just modifying an existing TFT.h project,  it is easier to stick with the rather un-intuitive methods.

If you are writing a new project,   I would use an Adafruit style library.   e.g. Adafruit_ST7735 or Bodmer's TFT_ST7735.   There are several other compatible libraries.

The main advantage is that you can port your ST7735 project to work on a different controller e.g. ILI9163 or the bigger ILI9341.

So it really comes down to new project or existing project.   Choose the strategy that is most suitable.

If you do go down the "re-write for Adafruit" route,  you might write a helper function that combines the Arduino setCursor() and print() functions.

David.

Bwanna

Appreciate the advice.  So far it looks like it's working, but I didn't notice my total byte count went up quite a bit using Bodmer's TFT_ST7735 file... The transition to cursor/print actually went fairly easily.

bodmer

@Bwanna,

Under the bonnet (hood in the USA!) the IDE TFT libray uses the Adafruit GFX core so many of the functions should be compatible.

The sketch size depends on the fonts you have enabled, edit the User_Config.h file to disable fonts you do not need.

Good luck with your project.
Formerly Rowboteer (now a broken user profile!)

tbillion

hey i have an st7735R ... its a little rough and a few years old, has been left out in the rain drowned in a few puddles and spent about 2 months underwater but still works ... i can run this code on it and share results ... in trade can we maybe get it to where one of these st7735 librairies can actually send the op codes to the st7735, alot of the auto initialize stuff is stuff that can be changed on the fly it would be useful to be able to write commands and data live in program. simple function. commond and associated data variables. the adafruit library has the function in its setup routines but its not exposed to the userspace program .

bodmer


The write command and write data member functions are public and hence can be used in your sketch, e.g.:

Code: [Select]
tft.writecommand(uint8_t c);
tft.writedata(uint8_t d);
Formerly Rowboteer (now a broken user profile!)

tbillion

hmm could have swore i tried that , but maybe i didnt do it that way i will give it a try :) ty for the info!

Damircati

Only library that seems to work for my TFT 1.8 inch display is this one. Only thing that I am curious about is there any way you can add more custom fonts to this library like in GFX with FontConvert? or you can only use these default Fonts that come with the TFT_ST7735 library?

bodmer

@Damircati

Glad to hear it is working.  The library does not support the GFX Freefont format (which tends to be rather greedy on FLASH space).

Which Arduino board are you using?
Formerly Rowboteer (now a broken user profile!)

Damircati

I am using Arduino Nano board...is there any way to include other fonts than those default 7 fonts. I have seen some recommending GLCD Font Creator but I am not sure it works with this library, others recommend manually creating fonts with pixels but I think that would take too much time from me.

tbillion

i cant remeber exactly how this library works but i already converted some fonts. there is an adafruit script that will convert your regular fonts to tables that can be used in Uno and Nano... thats what these are if i remember correctly

https://forum.arduino.cc/index.php?topic=451857.msg3107834#msg3107834

if you cant figure it out PM me and i will convert the font file for you. I am pretty sure the method i used worked on these displays much like any other display

bodmer

@Damircati

The library featured in this thread was developed priot to the Adafruit font development and unfortunately it does not include the capability to easily add more fonts due to the way the complex way the fonts are encoded to enhance rendering speed and reduce the FLASH space needed.
Formerly Rowboteer (now a broken user profile!)

gpaCook

This is a year late, but I just ran into the offset background myself.  This post did lead me to where to go for a fix.  My display is a 1.8" Qianson SPI TFT display. 128x160 with a green tab.

Using the graphicstest example, I initialized using the INITR_BLACKTAB option of the initializer because comments said to use it for 1.8" displays.

Because of this post, in the Adafruit_ST7735 library I found the INITR_GREENTAB option.  This did fill the screen OK.  Only thing is, the colors are messed up:
  • Specify yellow -> you get green
  • Specify blue    -> you get red
  • Specify red     -> you get blue

I think the other colors work.  For me, my application is essentially monochrome, so, except for another color for emphasis (maybe), I'm good.  But, curious if there's another initializer I should use, or if this is a bug (doubtful, since this is an old issue).

david_prentice

You can either set the BGR bit in a Manufacturer Panel Register.
Or you set the BGR bit in User reg(0x36)  called MADCTL

I bet that Bodmer has already done this for you.   You just select the correct board in User_Config.h

David.

bodmer

Assuming you have the display as noted in post #1 of this thread then try the GREENTAB2 option, it should work and will compensate for the edge pixel offset.
Formerly Rowboteer (now a broken user profile!)

Go Up