Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Program to demonstrate data logging using an SD Card with a 3.5" TFT LCD Touchscreen Display (using ILI9486 Driver), Arduino UNO R3/R4 and MCUFRIEND Library

License

NotificationsYou must be signed in to change notification settings

Aditya-A-garwal/Arduino-TFT-LCD-3-5-SDCard-Logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub LicenseGitHub forksGitHub Repo starsGitHub issuesGitHub closed issuesGitHub pull requestsGitHub closed pull requestsGitHub Actions Workflow Status

Overview

This repository contains a program to log data to an SD Card on a 3.5" TFT LCD Shield along with an Arduino UNO R3/R4/Mega, as shown below -

Image of LCD Touch Shield from TopImage of LCD Touch Shield from Bottom

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 -

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.

Building/Uploading With PlatformIO

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

Building/Uploading With Arduino IDE

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.

Using the Example

Tip

Before using this example, make sure to calibrate the touchscreen and enter the calibration values in theconstants.h file, as shown inthis guide.

As soon as the program is uploaded, the display should turn black and the message "SD Card initialization failed" should get printed on the Serial Monitor. Insert aFAT formatted SD Card into the SD Card slot of the TFT LCD Shield and reset the program.

A small green square should be drawn on the top-left of the display, indicating that the program is running, and that it is safe to remove the SD Card/Power-off the board. When the screen is touched, the coordinates of the point are logged onto the SD Card on a new line in theLOGS.TXT file (this file is created automatically if it does not exist). Along with the coordinates, the timestamp of the touch is also stored.

The logs are not updated constantly, but at a rate of 1 Hz (only once per second). When IO is being performed with the SD Card, the square on the top-left of the display turns red, indicating that it is not safe to remove the SD Card/Power-off the board.

Troubleshooting

Some common problems and their solutions -

ProblemSolution
Display stays white after uploading programNon-Standard Driver (not ILI9486)
Display not responding after touchTry changing the order of the touch pins insrc/constants.h file, i.e. swap the values ofXP,YP,XM andYM
Compilation issues related to SPIUpdate the Arduino IDE version and/or install the SPI library
Display Flickering/Arduino is reset automaticallyFaulty Power Supply/Cable

[8]ページ先頭

©2009-2025 Movatter.jp