PushColors for ST7789 TFT 240*240 ?

Hi all display aficionados

With some TFT display shields for the Arduino Uno, e.g. ILI 9341, ILI9486, ILI9488 I use <mcufriend_kbv.h> which has a member named tft.pushColors. I use pushColors to write c-arrays from program memory ultrafast to display. This is necessary to create ‘realistic’ stop-motion animations, e.g. that of Muybridge’s horse. My goal is a Royal Ascot winner’s gallop!

I have acquired an incredibly sharp 1.3 inch 240*240 7-pins SPI TFT display. The controller chip is here a ST7789. The above picture is a still displayed via the <Arduino_ST7789.h> library’s function tft.drawBitmap

There exists libraries, <Arduino_ST7789.h> and <Adafruit_ST7735.h> that provide support for graphical functions. I am familiar with tft.drawBitmap, but that function is too slow to support animation.

My question: does anybody on this forum know whether there is a function for the ST7789 to read c-array bytes from program memory and send these to the display - e.g. similar to tft.pushColors in mcufriend_kbv ?

I think if you look, the library has it as a private member.
Just move it to the public section.

Adafruit_ST7789 inherits from Adafruit_GFX, Adafruit_SPITFT, Adafruit_ST77xx (also Print.h)

So you have to look at all of the class header files to see what public methods are available to you e.g.

Note that setAddrWindow(x, y, w, h) has different arguments to the MCUFRIEND_kbv setAddrWindow(x, y, x1, y1)

and writePixels() needs a chip-select and/or SPI transaction

Adafruit's hardware libraries are simple to extend but a nightmare to follow all the inherited methods.


Thanks, David and TheMemberFormerlyKnownAsAWOL,
Learnt something new: private and public members. What the heck are private members good for when they are visible in libraries? Are they? Gobsmacking, so to say!

You need to read thick books to understand this, e.g. Bjarne Stroustrup’s “The C++ Programming Language”.

And some books about object oriented design and programming.

public and private are obvious.

protected is the really cool feature.

In practice, the user only needs to know about public variables and methods.


push_colors? I was wondering what it does. if u used it pls explain how to use it. I could not locate any call to it in MCU_Friend lib. So I dont know what are the parameter vals passed to the push_color fn?

Thanks in advance