IOT

ESP32 & ILI9488 TFT Touch Screen Based Video Games

In this project, we will create a handful of video games utilizing ESP32 and a 3.5-inch ILI9488 TFT Touch Screen Display. Makerfabs manufactures the custom board, which consists of an ESP32-WROVER chip, a 3.5-inch TFT display, a 2-megapixel camera, and an SD card port.

But in this project, neither the camera nor the SD card slot will be utilized. Instead, we will use the ESP32 and ILI9488 TFT Touch Screen Display and develop Arduino code to handle video games. The board is programmable using either Arduino or Micropython code. This part, however, describes the usage of Arduino Code to create video games.

ESP32 3.5″ TFT Touch(Capacitive) with Camera

This excellent 3.5″ touchscreen display is powered by an ESP32-WROVER chip and includes a 2M-pixel OV2640 camera. The combination of these elements provides the ideal foundation for ESP32 applications such as video games.

ESP32 3.5" TFT Touch with Camera

The TFT LCD driver is essentially ILI9488 and has a screen resolution of 320×480 and a size of 3.5 inches. The ILI9488 LCD communicates with the ESP32 microprocessor through SPI. The SPI main clock may reach up to 60M80M, making the display suitable for video playback. This board’s camera module is an OV2640 Camera with a 2MP resolution.

This camera can be used for remote photography, facial recognition, and security system applications. While the camera is not in use, all of these pins can be used freely with the breakout connectors. The ESP32 display can then be connected to sensors or modules and used for any IoT application. The ESP32 chip supports programming in Arduino or MicroPython.

The board features a micro SD-Card slot for external SD-Card attachment. The SD card is capable of storing information and pictures. There is a USB Type-C port, which is essentially a USB to UART converter for ESP32 programming. Connecting a Type-C data cable to the board enables immediate code uploading.

ESP32 TFT Touch Screen Camera

Specification

  • 3.5-inch display, 320×480
  • Capacitive/Resistive Touch
  • ESP32-WROVER Controller
  • WIFI/ BLE Connection.
  • Onboard USB2UART convertor for ESP32 programming
  • 2M pixel OV2640 Camera
  • OV2640 supports output images up to 2 million pixels
  • LCD 3.5-inch Amorphous-TFT-LCD for mobile-phone or handy electrical equipment
  • LCD Driver: ILI9488
  • LCD Resolution: 320*480
  • Micro SD card slot on the board
  • NS2009: A 4-wire resistive touch screen control circuit
  • FT6236: single-chip capacitive touch panel controller Integrated Circuit
  • Power supply: 5V, Type-C USB

Purchase Link

There is two ESP32 3.5″ TFT Touch Screen with Camera variants. One is a resistive kind and the other is a capacitive type. You may utilize any display you choose. The buy link for both displays is provided below.

1. Resistive Type ESP32 TFT Touch Screen Camera – Purchase Link

2. Capacitive Type ESP32 TFT Touch Screen Camera – Purchase Link

Preparing & Programming the Board

1. Install the ESP32 boards supporting

Installing ESP32 Board to the Arduino IDE is required. To put up the link, select “File>Preferences>settings>Additional Boards Manager URLs “https://dl.espressif.com/dl/package_esp32_index.json

2. Install the LovyanGFX Library

LovyanGFX Library is a library for ESP32 and SAMD51 LCD Graphics drivers with touch support. It supports ILI9163, ILI9342, ILI9341, ILI9486, ILI9488, ST7735, ST7789, ST7796, and SSD1351 TFT Touch Screen Displays. Download this library and add it to the Arduino IDE.

LovyanGFX Library

3. Setting ESP32 Parameter in Tools Menu

ESP32 2048 Video Game

2048 Game

2048 is frequently played on a grey 4×4 grid with sliding numbered tiles that are moved with the four arrow keys. Every turn, a new tile with a value of either 2 or 4 will randomly appear in an empty space on the board. The tiles will glide as far as possible in the selected direction until they encounter another tile or the edge of the grid. If two tiles with the same value collide while traveling, they will combine into a single tile with the sum of their values. In the same move, the resulting tile cannot merge with another tile again.

ESP32 2048 Video Game

How To Play?

  1. Click the first row with your finger; the second and third rows are now visible.
  2. Clicking on the fourth row will bring down the second and third rows.
  3. If you tap the first column with your finger, the second and third columns will be removed.
  4. Click on the fourth column and the second and third columns will be correct.
  5. Of course, you can also use your fingers to move from the four squares in the center.

Source Code/Program

The following download contains the code/program files for the 2048 video game based on the ESP32 TFT Touch Screen Display. You can download and extract the code. Select the ESP32 Board and upload the code to it.

Source Code

Before uploading code, choose whether the touchscreen is capacitive or resistive.

#define NS2009_TOUCH //Resistive screen driver
#define FT6236_TOUCH //Capacitive screen driver

ESP32 Flappy Bird Video Game

ESP32 Flappy Bird Game

Flappy Bird is an arcade-style game in which the player controls the continually rightward-moving bird Faby. The objective of the game is to guide Faby through pairs of pipes with gaps of equal size and random heights. Faby drops automatically and ascends only when the player taps the touchscreen. Each successful passage through a pair of pipes yields one point for the player. If the player collides with a pipe or the ground, the game is over.`

Source Code/Program

The following download contains the code/program files for the Flappy Bird video game based on the ESP32 ILI9488 TFT Touch Screen Display. You can download and extract the code. Select the ESP32 Board and upload the code to it.

Source Code

Before uploading code, choose whether the touchscreen is capacitive or resistive.

/#define NS2009_TOUCH //Resistive screen driver
#define FT6236_TOUCH //Capacitive screen driver

The same product can be used to create your own ESP32 video games and game console.

Conclusion
I hope all of you understand how to design an ESP32 & ILI9488 TFT Touch Screen Based Video Games. We MATHA ELECTRONICS will be back soon with more informative blogs.

Leave a Reply

Your email address will not be published.