Arduino Uno TFT 2.4" ILI9342

On AliExpress there are a lot of screens meant for the Arduino's. Most of the time the driver chip is not mentioned in the description and that is how I ended up with 12 displays with the ILI9342 driver. Luckely AdaFruit has a library that supports the ILI9341 and from the documentation of those driver chips I found that they are almost identical. The difference is mainly the resolution. One has 320x240 and the othet 240x320. That means some axis need to be rotated and mirrored. Strange, but the colors were also inverted...

That is what I did in attached library. I included some demo code to test the functionality.

Using the display involves the following steps:

  1. Download the Arduino ide from https://www.arduino.cc/en/main/software
  2. Make sure the USB to serial chip of your Arduino is supported. For windows that could need one of the following: CH341SER_EXE or CP210x
  3. Download the ili9342 library
  4. Install the Arduino IDE
  5. Start the Arduino IDE
  6. Open "Sketch -> Include Library -> Add .ZIP Library..." and select the ili9342 library zip file
  7. Open "Sketch -> Include Library -> Manage Libraries...". Search for the GFX library and install it (including the dependencies)
  8. Open "File -> Examples -> TFTLCD-Library_ILI9342" and one of the example programs
  9. Select the correct Arduino board from "Tools -> Board"
  10. Select the correct serial port from "Tools -> Port"
  11. Upload the sketch to the arduin from "Sketch -> Upload"

Excercises:

  1. Change the number of brick columns and rows
  2. Change the size of the bat and ball
  3. Also add a point if the bat hits the ball
  4. Change the bounce angle of the ball depending on the spot where the ball hits the bat
  5. Make the bricks more colorful
  6. Change scoring depending on what color of brick is hit
  7. Make some bricks that need to be hit twice to be deleted
  8. ... Think of something youself :)