Making an image scroll on top of another on a ST7735 display

Hi there!

I have this project in which I want to replicate a roller blind movement on a screen using an Arduino Nano classic clone. In order to make this project, I have an Arduino card, a 1.8" TFT Display (160*128) which seems to be a ST7735, an SD card to store the image along with its SD card reader, breadboards and wires.

The goal of this is to have two images displayed on the screen: one in the background being the view you would see by the window, and one above it which would be the blind. Pressing the up or down button on a dedicated switch would make the foreground/blind image go up or down, while keeping the background image still.

I don't think moving the image is a big issue: I already found a way to do it using white squares that can move accross the screen or monochrome images loaded directly in the flash memory of the Arduino, both times with a black background.

What is an issue however is the "drag error" bug, like when your old Windows XP computer froze and moving a window would create dozens of copies of it printed in the background (like what's on this website).

I found a way to correct this with my white squares: by printing a black line to erase the trail the square was leaving behind it while moving. But I'm not sure this will also work with my images, especially considering the background will now be another image. I can use another black line, sure, but it will also erase the background image, which I don't really want.

Does anyone knows if this is possible? I'm using a Nano right now but I can use other cards if necessary.
Thanks in advance! (And sorry if my english is rusty too)

[EDIT: I forgot to add that I'm using the standard TFT library, but I can change it if needed)

First off. Please post a link to the actual display that you have bought. Or post a photo of the pcb so that we can read the model number, pin names etc.

If you want the blind to move as it reveals the picture you can do this in hardware. (if you are in portrait mode)

The ST7735S can scroll a block of rows vertically.
You simply draw a new row from the picture as the blind is "lifted".

I strongly advise you to bury "TFT.h" in a very deep hole.
There are several ST7735 libraries that can be used. Very few have explicit "scroll" methods but you can just add your own "helper" function to write to the ST7735S registers.

David.

Hi David,

Here's a link of the screen I have right here.

The blind can be in portrait or landscape mode, it doesn't really matter as long as the blind works.

I thought about drawing a new row of the background everytime the blind is lifted up, but I'm not sure of how I can do this. I'm a beginner with screens.

I'll try to find another library for my screen. Maybe the Adafruit one can do the trick?

Thanks in advance

Much simpler than the solution I was thinking about:

128 * 160 * 2 = 40960 bytes for a 16bit RGB copy in RAM.
On a Raspberry Pico RP2040 e.g. RP2040 (seeedstudio.com) you could easily store 3 copies, one original, one copy with the current blinds, and one for next. And do a fast copy to the display.

● 264KB of SRAM, and 2MB of on-board Flash memory

Jean-Marc

Thanks for the link. It says that it has a ST7735S.
Yes, Adafruit_ST7735 library allows you to write to the registers but you need a helper function.

The "vertical scroll region" only works up and down in Portrait.
In Landscape it is sideways. i.e. like a sliding door rather than a rising blind.

I suggest that you install Adafruit_ST7735 library and run all of the examples. I might write a sketch for you.

Note that your display has a 3.3V regulator chip so you can connect VCC pin to 5V. It expects 3.3V logic. You should use series resistors or level shifters with a 5V Nano. However the ST7735S seems to be forgiving even though the datasheet states that it is not tolerant.

I would use a 47R series resistor on LEDA pin if you are using 5V.

David.

I just tested most of the examples and they work fine, the only ones I couldn't use were the one asking for other parts like the seesaw one. graphicstest, displayOnOffTest and RotationTest all worked fine, so it might be a good start.

My LEDA pin is linked to the 3.3V Pin of the Arduino, VCC is connected to 5V but I didn't have any issues so far. I'll change that to 3.3V just in case.

LEDA to 3.3V should be fine but it is going through the wimpy Nano 3.3V regulator. LEDA to 5V via 47R resistor should also be fine.
Just check that the backlight is a comfortable brightness.

VCC to 5V is fine. That is what the Q1 regulator chip is there for.

David.

Hi again!

So I changed the program library from TFT.h to the Adafruit one, and for the moment, everything's work fine, or even better than with the last library.
I still have to try and connect the SD card to the Arduino for the moment, since the reader might be busted (or at least I think it is since it can't read any of my SD cards)
Also, @david_prentice , you were talking about a helper finction, but what is a helper function? I tried searching on the web and couldn't find anything that can help me in my project.

Thanks in advance!

EDIT: Forget about what I said, just found out what the Helper Function was: I knew what it is from the start but I just didn't know it was called like that

My "clever" idea about hardware scrolling the Blind upwards while revealing a fresh row from the picture does not work.

It is very easy to roll the picture into view as the Blind is raised but not to have a rising Blind revealing a stationary picture.

A "helper function" is when you write a function in your sketch that avoids having multiple repeated sequences.
In other words it "helps" you make the program shorter, neater and easier to manage.

I will continue to think about my "clever" idea but I am fairly certain it will need substantial byte traffic.

If your "Blind" is a simple graphic life would be much simpler. e.g. the viewer gets the impression of a rising blind but in reality you are only re-drawing a small area.

David.

By simple graphic, you mean like a monochrome bitmap for example? That can be something possible if using two BMP images won't work.
I'll try on my side as well to see what can I achieve with that library.
Thanks for the help, I really appreciate it

I was thinking more in terms of a solid colour "Blind" with just the "bottom tassels" appearing to rise up the screen. Perhaps a small text box "rises" too.
In other words the picture being revealed is a hi-res photo but the "Blind" or "rising curtain" is a simple graphic.

All the same, you could scroll the old picture out of the top of the screen while scrolling the new picture in at the bottom. Can look impressive. The hardware does it for you.

David.

Using a solid color blind could do the trick for now. I will try to see what can I do with a real blind image afterwards

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.