elegoo tft lcd library manufacturer

ALL THE CODES AND LIBRARIES THAT ELEGOO USED IN THE FILES ARE CREATED BY ADAFRUIT AND WE REALLY APPRECIATE ALL THE CONTRIBUTION THAT ADAFRUIT HAS MADE TO THE MAKER COMMUNITY.

elegoo tft lcd library manufacturer

In this Arduino touch screen tutorial we will learn how to use TFT LCD Touch Screen with Arduino. You can watch the following video or read the written tutorial below.

As an example I am using a 3.2” TFT Touch Screen in a combination with a TFT LCD Arduino Mega Shield. We need a shield because the TFT Touch screen works at 3.3V and the Arduino Mega outputs are 5 V. For the first example I have the HC-SR04 ultrasonic sensor, then for the second example an RGB LED with three resistors and a push button for the game example. Also I had to make a custom made pin header like this, by soldering pin headers and bend on of them so I could insert them in between the Arduino Board and the TFT Shield.

Here’s the circuit schematic. We will use the GND pin, the digital pins from 8 to 13, as well as the pin number 14. As the 5V pins are already used by the TFT Screen I will use the pin number 13 as VCC, by setting it right away high in the setup section of code.

I will use the UTFT and URTouch libraries made by Henning Karlsen. Here I would like to say thanks to him for the incredible work he has done. The libraries enable really easy use of the TFT Screens, and they work with many different TFT screens sizes, shields and controllers. You can download these libraries from his website, RinkyDinkElectronics.com and also find a lot of demo examples and detailed documentation of how to use them.

After we include the libraries we need to create UTFT and URTouch objects. The parameters of these objects depends on the model of the TFT Screen and Shield and these details can be also found in the documentation of the libraries.

So now I will explain how we can make the home screen of the program. With the setBackColor() function we need to set the background color of the text, black one in our case. Then we need to set the color to white, set the big font and using the print() function, we will print the string “Arduino TFT Tutorial” at the center of the screen and 10 pixels  down the Y – Axis of the screen. Next we will set the color to red and draw the red line below the text. After that we need to set the color back to white, and print the two other strings, “by HowToMechatronics.com” using the small font and “Select Example” using the big font.

elegoo tft lcd library manufacturer

I don"t know whether this is possible or not but is there any way that I can run something similar to Android on a normal TFT. I want to make complex graphics but can"t program those complex programs using the Adafruit TFT library.

elegoo tft lcd library manufacturer

I had some success with this. By observing the sketches I decided that at least in the BMP sketch that A5 did not seem to be used. I have another Shield called the Dr Dunio that can redirect most of the GPIO pins to another option by use of a jumper. I placed the Dr D shield in my UNO and then placed the LCD shield on top of it. The Dr D board has 16 jumpers that can be in one of two positions. With the jumper in a position marked with a dot the pin effectively goes straight through to the header where the LCD shield is installed. So with all jumpers in the dot positions, the Dr D shield passes all pins straight through. I determined that the jumper on pin A5 could be placed in the dot position, the non dot position and even removed and the LCD sketch worked properly. I then put the Dr D jumper on the non dot position which connects it to a pot on the Dr D shield. I added in a few lines of code which did an analogRead (A5) and printed it out on the Serial Monitor. I could change the pot of the Dr D board and see a corresponding change in the Serial Monitor. All the while the pictures on the LCD screen were acting as before. This leads me to believe I can use A5 for my own purposes. Unfortunately my choices are somewhat limited with only this pin available.

elegoo tft lcd library manufacturer

So I bought myself another one of the Elegoo 2.8″ touchscreen LCD modules recently, and decided to have a deeper dive into the code. I looked through the examples and I thought “This looks very similar to code from Adafruit.”

You can download the original “tutorial” files from Elegoo directly at https://www.elegoo.com/pages/arduino-kits-support-files if you’d like to take a look for yourself.

The code was the same. The Elegoo_GFX library was an exact copy of the Adafruit GFX library, just with a global find and replace “Adafruit” for Elegoo. You can test this by changing the library definition in the code to use the Adafruit one and everything will still work.

It took me the best part of an afternoon to finally figure out exactly how it worked. They have only made (from what I can tell) a single change to the library under definitions for the Arduino Mega 2560 in the code.

The only other changes you need to make to your code are when you start the tft.begin, you need to specify a fixed identifier, for example the following code (based on the graphicstest example)

I’m waiting for Amazon to publish my product review, as I think this a totally unfair use of Adafruit’s source code and quite a clear ethical violation of the ethos of open source code. They could have easily forked the library and added their changes… Maybe it would have even been accepted up stream if people would find using similar displays with the Adafruit library on the Mega 2650.

You don’t have to do any library edits like above, other than defining #define SPI_DRIVER_SELECT 2 within SdFatConfig.h (in your libraries folder), then you can put your 24bit BMP images on your SD card and load them when using this module without any of the massive amount of effort I went through today