How to Display Animated GIF on OLED/TFT (ESP32, Arduino, ESP8266)

preview_player
Показать описание
Here's a quick tutorial that shows you how to display an animated GIF on a OLED or TFT display using the SPI protocol. It should work on any microcontroller that is supported by the Arduino IDE. In this example no external SD card is required. All you need is a microcontroller and a OLED or TFT display that supports SPI. It's a good idea to use an ESP8266 or ESP32 for this rather than an Arduino Uno, as significant memory is required. A regular ESP32 potentially has enough RAM to display 6 different 128x128 animations (but it does depend on how long they are!).

00:00 - Introduction
00:24 - Arduino libraries
01:35 - ESP32 SPI pin diagram
01:48 - Code walkthrough
03:39 - Preparing animated GIFs
05:22 - Convert animated GIFs to C code
06:41 - Animated GIF data in Arduino IDE
07:46 - Lower memory alternative

In the tutorial I'm using the Waveshare SSD1351. It has a 128x128 pixel display. Incidentally the screen flicker isn't really noticeable with the human eye.

You can use any animated GIF with this method, so it's great if you want to display memes and funny animations on your display. It's a really cool school or beginner project too. I recommend you resize the GIF first though so it fits on the display. See below for an online image resizer, or resize them in a graphics package that supports animated GIFs.

The animated GIF display library I recommend is called by AnimatedGIF Larry Bank. You can install it through the Arduino IDE. It supports many different graphics libraries and protocols but I recommend using it with Bodmer's TFT_eSPI library. You will probably already have this installed if you've done any other work with your OLED or TFT display.

Рекомендации по теме
Комментарии
Автор

Will this work with tft lcd ili9486 and mega2560

jaykibo
Автор

it gives me the void error for GIFDraw, how do I fix that?

itsjusttimeless
Автор

Everyone seems to love the TFT_eSPI library.... I have not been able to get the TTGO to work with the TFT_eSPI library at all. I finally got it to quit giving a compile error when I went back to the Arduino 1.8 IDE. But still no video. At first I blamed the TTGO but I got it running the Adafruit display example using code that does not use the TFT_eSPI library. So I know everything actually works and going through the library's files I cannot find anything outstanding that is causing a problem.

rickrandazzo
Автор

The gif doesn't appear on my oled display, what could be causing this issue?

SuperHimbob
Автор

whats the longest gif i can run on this or what mb size gif is the max

robpewpew
Автор

Hi,

Ive followed this video but got a compilation error 'homer' was not declared in this scope.

What does this mean?

jordannorton
Автор

my colors are inverted for some reason. Any ideas?

kodykoala