Display Picture using TFT Display and Arduino Mega | MCUFRIEND Library

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello viewers uh in this video we will learn how we can display images on tft display for this tutorial i am using arduino mega uh for using arduino mega we need to make a few changes on the library and if you're using arduino then you don't have any problem so first we need to prepare the images okay so i want to display this image on the lcd screen as you can see it is a it is in dot jpg format the first thing is to do is that convert this image into bmp format uh the card reader attached to the tft display it cannot read images in jpg format so let's open it with the paint software and from here you need to resize it so click on the resize option and from here you need to choose pixels be sure to make this size smaller than the size of your display in this case i am using a 2.4 inch display that is 280 into 320 size so keep it within the range and after resizing it go to file and from here choose save and bmp picture and save this file uh into the memory card or the sd card uh that you will connect with your um tft display so save it in that place okay i have done it already and please save it in the root directory do not save it in under any folder so after uploading the image into your memory card now it's time to plug the memory card into the card reader of your lcd shield so you just need to press it and it will be fixed now you need to plug in your tft display with your uh arduino mega so you need to be careful about the pin connections you can see here uh this channel we got the ground 5 volt and the 3.3 volt and this goes on this direction and you need to carefully connect it okay so these are the pin configuration of the arduino uno so just press it and now the connection is done okay it's time to prepare the code now we need to install the mcu friend library uh this will use this library for controlling the dft display so go to your sketch and from here input library and choose the manage library option i am using the arduino 2.0 version the library manager opens up here if you are using the previous version the classic version it may appear differently so search it by mcu friend and install this library by david prindes and install the latest version okay now we need another library for reading the sd card data that is called the sd5 library so search by sd fat okay you can see here i have this defect library and you can see the installed version uh it is installed i have the installed version 1.0.1 so please install this version i have tried with the latest version it does not work with the latest version uh maybe there will be an update so uh use this version 1.0.1 it will work fine okay after uh these libraries are installed we need to make two changes uh one on the mcu friend library to enable arduino mega and another one on the uh the sd5 library you can read the documentation here it says that you need to edit the sdfatconfig.h and you need to enable the software spi spi to one so now let's do it okay navigate to the directory where the mcu friend library is installed so it is in my case it is under the documents arduino and then libraries then mcu friend kbv from here you need to open this cpp file and read it with notepad plus plus you can use any text editor and from here you need to uncomment uh these defined options uh please match this if you have any of this commented you need to uncomment on all of this and after that you need to save it okay now the second task we have created the sd5 library so this default source and from here the sd5config.h okay now we need to find this line enable software spl plus okay i found it you can see i have set it to one uh in your case uh it should it would be zero uh and if it is already one you don't need to do anything but if it's by default it's zero so you need to change it to one and then save it okay we have done everything needed for displaying bitmaps on the tft display okay so this is the code uh for this uh tutorial so this is just a one line code the show bmp this function this function is implemented below the show bmp function it reads data from memory card and then displays it so you can see here the first option you need to place the name of the file in your sd card that you want to display uh then the second position is the uh the second parameter is the x position on the display and the third parameter uh it's the y position in the display where you want to uh display this image and these are used to make the progress bar so if you read it carefully you'll understand it i will add comment later so after five second i am cleaning the skin again and then printing it all over again so everything is ready now let's upload the code [Music] okay the uploading is complete now let's see it [Music] you
Info
Channel: Microcontrollers Explained
Views: 16,424
Rating: undefined out of 5
Keywords: arduino lcd display, arduino, tft display, arduino tft touch screen, arduino tft, arduino mega, lcd display arduino, arduino mega tft shield, how to display picture in arduino tft display, how to display picture in tft display
Id: gN1B9ZesZ1Q
Channel Id: undefined
Length: 8min 55sec (535 seconds)
Published: Tue Jun 07 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.