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

Coding With Brett
Coding With Brett
5.7 هزار بار بازدید - 5 ماه پیش - Here's a quick tutorial that
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. Animated GIF library: github.com/bitbank2/AnimatedGIF Animated GIF to c converter (image_to_c): github.com/bitbank2/image_to_c Resize animated GIFs (basic): ezgif.com/resize Resize animated GIFs (advanced): redketchup.io/gif-resizer
5 ماه پیش در تاریخ 1403/01/23 منتشر شده است.
5,787 بـار بازدید شده
... بیشتر