Introduction: Arduino 2.4″ Touch Screen LCD Shield Tutorial
In this tutorial, you will learn how to use and set up 2.4″ Touch LCD Shield for Arduino. First, you’ll see some general information about this shield. And after learning how to set the shield up, you’ll see 3 practical projects.
What You Will Learn:
- View text, writing and arbitrary geometric shapes with custom colors
- View high-quality BMP colored pictures
- create the Paint software
Step 1: Arduino 2.4 Touch Screen Shield Features
The role of screens in electronic projects is very important. Screens can be of very simple types such as 7 Segment or character LCDs or more advanced models like OLEDs and TFT LCDs.
Suggested Reading: Absolute Beginner’s Guide to TFT LCD Displays by Arduino
2.4” TFT shield is one of the most widely used graphic screens. Here are its most important features:
- 240*320 pixels resolution
- Ability to display 262000 different colors
- Includes a touchpad
- 5v supply voltage
Arduino pins 2, 3, A5, and A4 are free and you can use them to connect this shield.
Step 2: Required Libraries for 2.4 Touchscreen
The TFTLCD library supports 932x, 7575, 9341, and HX8357D derivers.
If your LCD does not work with this library, try the Mcufriend_kbv.
You can apply commands to this LCD using pins A0 to A5. In case of using an SD card, all Arduino pins will be busy.
To display stable images, we recommend you to use an adaptor instead of the USB port.
Step 3: How to Calibrate the Touch Screen?
One of the most important features of this LCD is including a touch panel. If you are about to use the LCD, you need to know the coordinates of the point you touch. To do so, you should upload the following code on your Arduino board and open the serial monitor. Then touch your desired location and write the coordinates displayed on the serial monitor. You can use this coordination in any other project.
TSPoint p = ts.getPoint(); stores the length (x), width (y) and compression (z) in the p object.
Step 4: Displaying Text and Shapes on Arduino 2.4 LCD
For more information on code and functions please check Basic TFT LCD Commands.
To display pictures on this LCD you should save the picture in 24bit BMP colored format and size of 240*320. Then move them to SD card and put the SD card in the LCD shield. we use the following function to display pictures. This function has 3 arguments; the first one stands for the pictures name, and the second and third arguments are for length and width coordinates of the top left corner of the picture.
Step 6: Create a Paint App W/ Arduino 2.4 Touchscreen
Step 7: Final Notes
- If you want to display pictures without using an SD card, you can convert it to code and then display it. You can display even several photos sequentially without delay to create an animation. (Check this) But be aware that in this case, Arduino UNO may not be suitable (because of low processor speed). We recommend using the Arduino Mega or Arduino DUE.
- When purchasing this LCD, make sure that drivers are supported by the libraries listed.
Step 8: Buy 2.4 TFT LCD Display Shield
Step 9: Like Us on Facebook
If you find this tutorial helpful and interesting please like us on facebook.