TFT displays bring life to the project. Why shy with the LCD character display? OLED displays look good and stand out too but small size and limited colors limit the application to basic graphics but are still colorless. No color? No life!
Having the option of TFT display in your next Arduino project can add so many vibrant menu options, can display images, and hence can be a very rich user experience thing.
This is a very basic example of displaying a few texts on the display. We will use the library from Adafruit for the same. The best thing about the Wokwi Embedded systems simulator is that you can run the code straight from the browser. It means, you can easily share the project (as a link) and your friend can run it and lay with the project.
In this article, you will get a working Arduino project which has a simulated TFT display. The display will exactly work in the same way how it would work in the real world and with the real hardware. You can try any TFT project you have!
Let us get started. You will complete the code, connection diagram as well as live working Arduino simulation link so that you can start playing with the code instantly! For more information on the Simulated TFT display, click here.
Connection diagram - ILI9341 TFT display and ArduinoLCD Ground ---> UNO Ground
LCD VCC ---> UNO 5 V
LCD SCK ---> UNO Pin number 13
LCD MISO ---> UNO pin number 12
LCD MOSI ---> UNO Pin number 11
LCD CS ---> UNO Pin number 10
LCD D/C---> UNO Pin number 9
Arduino Code - ILI9341 TFT display and Arduino/*
Simple "Hello World" for ILI9341 LCD
https://wokwi.com/arduino/projects/308024602434470466
*/
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#define TFT_DC 9
#define TFT_CS 10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
void setup() {
tft.begin();
tft.setCursor(26, 120);
tft.setTextColor(ILI9341_RED);
tft.setTextSize(3);
tft.println("Hello, TFT!");
tft.setCursor(20, 160);
tft.setTextColor(ILI9341_GREEN);
tft.setTextSize(2);
tft.println("I can has colors?");
// Meme reference: https://english.stackexchange.com/questions/20356/origin-of-i-can-haz
}
void loop() { }
Arduino Simulation - ILI9341 TFT display and ArduinoArduino Code Simulation Link:
https://wokwi.com/arduino/projects/308024602434470466?ck_subscriber_id=972903999
If you have any feedback, please share it in the comments section or hop on to the Wokwi Discord channel
Share your interesting projects and browse through several curious projects from fellow developers and makers on Facebook Wokwi Group!
Stay Safe!
Don't stop learning!
#WokwiMakes
Comments