- Notifications
You must be signed in to change notification settings - Fork0
Program to demonstrate the usage of configuration files as separate entities from the program, using an SD Card with a 3.5" TFT LCD Touchscreen Display (using ILI9486 Driver), Arduino UNO R3/R4 and MCUFRIEND Library
License
Aditya-A-garwal/Arduino-TFT-LCD-3-5-SDCard-Config-File
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This repository contains a program to read a config file from an SD Card and use the data to change the program execution on an Arduino UNO R3/R4/Mega nad a 3.5" TFT LCD Shield, as shown below -
![]() | ![]() |
|---|
Most 3.5" TFT LCD Touch displays use the ILI9486 Display Driver and include a resistive touchscreen.The PCB Layout & silkscreen text may vary slightly between displays. This does not change their behaviour and functionality. This repository depends on the following libraries -
- Adafruit Touch Screen Library to manage touch input
- Adafruit GFX Library for graphics primitives
- This fork of the MCUFriend KBV library to drive the display (this makes it compatible with the UNO R4)
The program has been written using PlatformIO, and has been tested on theArduino UNO R3,Arduino UNO R4 Minima &Arduino UNO R4 WiFi.
Tip
A detailed tutorial on how to use this repository is available athttps://dumblebots.com/2024/07/02/using-3-5-tft-lcd-display-with-ili9486-arduino-part-3-text-files-sd-card/. The tutorial includes a comprehensive explanation of the code and how to use it.
Since this project has been written using PlatformIO by default, simply run the following commands to fetch the libraries, build the project and upload the program -
pio pkg installpio runpio run --target upload
Create a new sketch and copy the contents ofsrc/main.cpp from this repository into the default.ino file. Create a new tab/file in the IDE namedconstants.h and copy the contents ofsrc/constants.h from this repository into this file.
Install the Adafruit Touch Screen Library and Adafruit GFX Library from the Library Manager (underSketch>Include Library>Manage Libraries...)
Downloadthis repository as a ZIP file and install it by navigating toSketch>Include Library>Add .ZIP Library, and selecting the downloaded file from the file explorer.
After this, you can Build and Upload the program as usual.
As soon as the program is uploaded, the display should turn black and the following message should be printed on the display -
Next, create a file calledCONFIG.TXT on aFAT formatted SD Card, which will be inserted into the SD Card slot on the TFT LCD Shield. The file must contain three color codes, which will be used to draw three squares on the display. Two examples are shown below -
Config file -
square-1-color" = f800""square-2-color" = "07E0""square-3-color" = "001F"Result -
Config file -
"square-1-color" = "fFe0" // Yellow"square-2-color" = "7ff" // Cyan"square-3-color" = "F81F" // MagentaResult -
Tip
To create your own colors, seethis guide.
Some common problems and their solutions -
| Problem | Solution |
|---|---|
| Display stays white after uploading program | Non-Standard Driver (not ILI9486) |
| Display not responding after touch | Try changing the order of the touch pins insrc/constants.h file, i.e. swap the values ofXP,YP,XM andYM |
| Compilation issues related to SPI | Update the Arduino IDE version and/or install the SPI library |
| Display Flickering/Arduino is reset automatically | Faulty Power Supply/Cable |
About
Program to demonstrate the usage of configuration files as separate entities from the program, using an SD Card with a 3.5" TFT LCD Touchscreen Display (using ILI9486 Driver), Arduino UNO R3/R4 and MCUFRIEND Library
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.




