Tutorial for ILI9341 TFT LCD SD and Arduino MEGA (part 3)

This is the project that makes work the TFT capabilities of the screen plus the LCD itself

Mar 20, 2021

3940 views

0 respects

Components and supplies

1

ILI9341

1

Jumper wires (generic)

1

Arduino Mega 2560

Project description

Code

Very light TFT code

arduino

//Screeen #include <ILI9341_kbv.h> ILI9341_kbv my_lcd; #define vali0 0 //TFT Touch Library #include <LCDWIKI_TOUCH.h> LCDWIKI_TOUCH my_tft(44,52,50,51,46); //tcs,tclk (sharing with LCD),tdout (MISO) ,tdin (MOSI) ,tirq void setup() { my_lcd.begin(); my_lcd.setRotation(1);// Landscape my_lcd.fillScreen(TFT_PINK);// set color iitial screen //Define the values for tft ( rotation,With,Height) my_tft.TP_Init(1,240,320); } void loop(){ my_tft.TP_Scan(0); if (my_tft.TP_Get_State()&TP_PRES_DOWN) { my_lcd.fillScreen(TFT_RED);// set color iitial screen delay(1000); my_lcd.fillScreen(TFT_PINK);// set color iitial screen } }

Very light TFT code

arduino

//Screeen #include <ILI9341_kbv.h> ILI9341_kbv my_lcd; #define vali0 0 //TFT Touch Library #include <LCDWIKI_TOUCH.h> LCDWIKI_TOUCH my_tft(44,52,50,51,46); //tcs,tclk (sharing with LCD),tdout (MISO) ,tdin (MOSI) ,tirq void setup() { my_lcd.begin(); my_lcd.setRotation(1);// Landscape my_lcd.fillScreen(TFT_PINK);// set color iitial screen //Define the values for tft ( rotation,With,Height) my_tft.TP_Init(1,240,320); } void loop(){ my_tft.TP_Scan(0); if (my_tft.TP_Get_State()&TP_PRES_DOWN) { my_lcd.fillScreen(TFT_RED);// set color iitial screen delay(1000); my_lcd.fillScreen(TFT_PINK);// set color iitial screen } }

Downloadable files

Connections

Connections

Connections

Connections

Connections

Connections

Comments

Only logged in users can leave comments

roger_marin

0 Followers

0 Projects

Table of contents

Intro

0

0