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:
- Download the Arduino ide from https://www.arduino.cc/en/main/software
- 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
- Download the ili9342 library
- Download the touchscreen library from https://github.com/adafruit/Touch-Screen-Library
- Install the Arduino IDE
- Start the Arduino IDE
- Open "Sketch -> Include Library -> Add .ZIP Library..." and select the ili9342 library zip file
- Do the same for the touchscreen library
- Open "Sketch -> Include Library -> Manage Libraries...". Search for the GFX library and install it
- Open "File -> Examples -> TFTLCD-Library_ILI9342" and one of the example programs
- Select the correct Arduino board from "Tools -> Board"
- Select the correct serial port from "Tools -> Port"
- Upload the sketch to the arduin from "Sketch -> Upload"
- Change the number of brick columns and rows
- Change the size of the bat and ball
- Also add a point if the bat hits the ball
- Change the bounce angle of the ball depending on the spot where the ball hits the bat
- Make the bricks more colorful
- Change scoring depending on what color of brick is hit
- Make some bricks that need to be hit twice to be deleted
- ... Think of something youself :)