prenticedavid / AnimatedGIFs_SD

Display GIFs from Flash, SD or SPIFFS
64 stars 14 forks source link

How to connect SD-Cardreader to ESP32 fpr AnimatedGIFs_SD #3

Open hru2020 opened 4 years ago

hru2020 commented 4 years ago

I'm using an ESP32 with connected OLED 240x240 Pixel. I would like to use your AnimatedGIFs_SD to display Gifs on the Oled. Perhaps you can give me some hints how to connect the following cardreader to my ESP32 ( the reader should be used by your AnimatedGIFs_SD ) -> https://www.ebay.de/itm/ESP8266-ESP32-Arduino-AVR-STM-SPI-Standard-SD-Kartenleser-Card-Reader-3-3-5V/283021780601?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649

prenticedavid commented 4 years ago

That is a regular SD card holder. It takes monster SD cards. Or microSD with an Adapter. Connect to the SPI bus. Use a separate GPIO pin for SD_CS.

The biggest problem is your 240x240 OLED. I have never seen one. There are 240x240 TFTs without CS pin. These are a nightmare.

David.

Adrianormrs commented 3 years ago

Did you figured out how to work with the 240x240p tft? I have this same screen and I can use it with TFT_eSPI library, but didn't work with this one for me.

prenticedavid commented 3 years ago

I have not done anything with this code for a long time.

I am busy with other things. Please post a link to the actual screen that you have bought. Then when I have time I will test with TFT_eSPI and a similar screen.

Do you intend to use a SD or SPIFFS ?

David.

Adrianormrs commented 3 years ago

The one I have is exactly like this, I want to use SPIFFS for 3 short gifs

https://www.ebay.com/itm/1-3-Inch-Ips-Hd-Tft-St7789-Drive-Ic-240-x-240-Spi-Communication-3-3V-Voltag-J6G2/184122513170?epid=12029868722&hash=item2ade8e9712:g:bUYAAOSwYupeGLko

Adrianormrs commented 3 years ago

Forgot to say I'm using ESP8266..

prenticedavid commented 3 years ago

I am running the Adafruit_opt Branch on a Wemos D1 R1 with the same ST7789 display as you.

There are several example GIF files in the sketch /data directory. You may want to move some of them before you try uploading to SPIFFS.

Then the sketch should just run. Showing the GIFs from SPIFFS.

I am tired. And have forgotten how this project works. Please let me know how you get on. e.g. test your ST7789 with the TFT_eSPI examples e.g. check what files you have stored in SPIFFS

David.

Adrianormrs commented 3 years ago

It worked! I think the reason it was not working before was because the gif's resolution, now I've added a new one and it's smooth.. Now I'm trying to understand most of your code to add only the parts I need in my sketch.

Thanks.

prenticedavid commented 3 years ago

Either attach your GIF files or post links to the GIF files.

Do you want to specify GIF files by name? Or just put the files into SPIFFS and let the example display each GIF in turn.

David.

Adrianormrs commented 3 years ago

I want to get the GIF by name from SPIFFS, and show it when triggered by an action from my sketch, that's why I need more then one GIF, for different triggers .

Adrianormrs commented 3 years ago

01Ryzen 02RTX

These are de GIFs I'm using for now

prenticedavid commented 3 years ago

Your GIFs are not too big. They will fit in regular PROGMEM or in SPIFFS.

The example sketch can display GIFs from SPIFFS, SD or PROGMEM. You can run for a specific time or run for N animations.

Or implement logic to behave how you would like.

David.

Adrianormrs commented 3 years ago

Hi, David!

I merged my sketch with yours and it had a weird behaviour, I put the GIF decoder part into a function that only receives the index number, when I just call the function on loop, it works well. https://drive.google.com/file/d/15baP7R4ejYsFFIy-rVEY_E9wxV6bQYdn/view?usp=sharing

But when I add my part of the code that receives data from my PC and displays on the screen each second for 30 seconds, that occurs.. https://drive.google.com/file/d/1MP4IuxMkgOoncLk9wIE4vRoZa46ibsIl/view?usp=sharing

It seems like the functions are running at the same time, and overlapping the screen information. I didn't found a way to prevent the GIF decoder to play when it is not called.

prenticedavid commented 3 years ago

If you want help, post your code. And say how you want it to behave.

Adrianormrs commented 3 years ago

Hi, here is my skecth based on yours. I want it to play the 2 GIFs and then show the data that comes from HardwareSerialMonitor for 30 seconds, updating each second, and keep in that cycle.

Thanks for your help.

GIFs_PC_Monitor.zip HardwareSerialMonitor_v1.1a.zip