esp32 tft display library factory

TFT_display_init() Perform display initialization sequence. Sets orientation to landscape; clears the screen. SPI interface must already be setup, tft_disp_type, _width, _height variables must be set.

compile_font_file Function which compiles font c source file to binary font file which can be used in TFT_setFont() function to select external font. Created file has the same name as source file and extension .fnt

esp32 tft display library factory

I"ve bought on AliExpress a cheap 1.77 color display module. Getting it to work on an Arduino was straight forward. But the Arduino is slow. I also got it working on an Esp8266, which was also straight forward. However getting it to work on an ESP32 was a little harder. I"ve tried several libraries, e.g. AdaFruit and UcgLib. These didn"t work. After some investigations the SPI speed was too high for the display. I tried to change the libs to reduce the speed. I didn"t work either.

So I left the project a few weeks and I started again. I searched for all possible libraries for ST7735 and ESP32. I found some and there was one I manged to get to work.

After tweaking the user_setup.h file I managed to get it to work.The settings that ware important to change was to change the ST7735 defines. Default I choose the first. This one didn"t work. I reduce SPI speed, which had no effect either. Than after some changes and tweaking connections and setting I finally worked. The ST7735 defines all work except the first one with my TFT-screen. I reset all to default and the SPI-speed and it kept working. It works at a 27 MHz speed, which leave me with 450 ms for the 11 test pages. If I increase the speed to the next value of 40 MHz I see errors in the display. So 27 MHz is max for me.

I also checked all other ST7735 defines, and for my TFT the ST7735_GREENTAB3 showed the correct colors. The other values show the wrong colors, but gave an image.

esp32 tft display library factory

Open Arduino IDE, find TFT_eSPI in the file and example, the T-Display factory test program is located at TFT_eSPI -> FactoryTest, you can also use other sample programs provided by TFT_eSPI

3 In the Arduino IDE tool options, select the development board ESP32 Dev Module, select Disable in the PSRAM option, select 4MB in the Flash Size option, Other keep the default

esp32 tft display library factory

were missing for my display (hailege, 2,8 tft, spi, il9431, https://www.amazon.de/-/en/gp/product/B07YTWRZGR/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1). so it might just be that the led backlight isnt being turned on. but of course the tip might not help with the st7796s.

esp32 tft display library factory

Variables, initializers, etc.Right below #include I added the Button2 library with #include and the bootlogo with #include "bmp.h".

This is a thing of which I don"t know what it does and how it works. I just copied it from the examples of LilyGO"s TTGO T-Display repository:Then I added #define TFT_BL 4 from the TTGO T-display example sketch. This sets the pinnumber of the backlight of the ST7789V screen.

The backlight can be controlled with a PWM signal so I added an option to the menu to set the initial backlight intensity. The initial value can be set up at int ledBacklight = 80; The default of my demo sketch is 80 but you can set it to any number in the range of 0 to 255. If you set it at 0 the backlight will be off. All graphics will be send to the display but you won"t see anything on the screen. The default TFT_eSPI and ArduinoMenu examples dont"t set the backlight and the first issue I encoutered was seeing nothing on the display. The actual issue was not setting the backlight to the on state.

I"ve changed TFT_eSPI gfx; to TFT_eSPI gfx = TFT_eSPI(135, 240); to provide the TFT_eSPI library the dimensions of the screen. The screen is driven as portrait mode and so the width is the small side with 135 pixels and the height is the long side with 240 pixels. In the sketch image rotation is enabled and thus everything will be displayed in landscape mode (quarter clockwise).

Button2 btnDwn(BTN_DWN);Because PWM parameters on a ESP32 can"t be set with the analogWrite() function because of lack of support for it in the board properties we need to set the PWM frequency, resolution and channel manually. After that we need to attach a pin to a PWM channel. Later on in the script you"ll see how this works but first right after int ledCtrl=LOW; we set the values we need:

esp32 tft display library factory

The component TFT supports a 2.8 inch TFT display with a resolution of 240*320 pixels.The display is not soldered on the board, but there is a 14 pin connector for a TFT display. The ILI9341 has been tested.

There are four sample projects for the Arduino IDE which could be downloaded: TFT-Box3D (download here), TFT-Graphic-Test (download here), TFT-HelloWorld (download here) and TFT-HowToUseFonts (download here). And there are two examples for the Arduino IDE for using the touch functionality which could be downloaded: TFT-TouchBtn (download here) and TFT-TouchDraw (download here).

There are two dip switches for the component: SW311 and SW314. If you want to use the TFT display all switches on SW311 have to be on on. If you additonally want to use the touchpad of the display all switch of SW314 have to be on. The following two tables shows the functions and the potential conflicts with other components

After the download it"s necessary to add both libraries to your Arduino IDE. Open Sketch > Include Library > Add .ZIP Library ... and select the downloaded archive. Do it for both libraries.

There are four sample projects for the Arduino IDE which could be downloaded: TFT-Box3D (download here), TFT-Graphic-Test (download here), TFT-HelloWorld (download here) and TFT-HowToUseFonts (download here).

And there are two examples for the Arduino IDE for using the touch functionality which could be downloaded: TFT-TouchBtn (download here) and TFT-TouchDraw (download here).

esp32 tft display library factory

In a previous article, we’ve looked into adding visual elements to a generic TFT screen for our primary flight display. But what a waste it would be if we didn’t utilize the screen to its fullest. That is why today we will bring our flight display to the next level by adding touch support. This guide will work with screens driven by ILI9341, ILI9481, ST7789, and many more chips.

Because an Arduino struggles to drive a 4-inch LCD display I’d highly recommend using a more powerful board like the Teensy, STM32, or my favorite the ESP32. The ESP32 has that perfect balance between price, performance, and features. This will also be the board we will use for this guide. This doesn’t mean you can’t use a different board but if you do there is a chance you need to find libraries that are tailored to your specific board.

Now we know how it works it’s time to start coding. The first thing we need to do is include our libraries and create a TFT_eSPI object and a BitsAndDroidsFlight32 object. The TFT_eSPI class contains all the logic we need to display visual elements and register our touches. By creating an object we can access all these functions that belong to the class by referencing our object.

To see if our touch screen logic works we need to add some visual elements to press. If you’ve been following along with the radio display video you’re able to use those elements as a starting point. To keep things clean and tidy I will be adding 2 empty buttons to demonstrate the logic used.

Buttons with rounded corners look more appealing than sharp corners. The TFT_eSPI library has a function called tft.fillRoundRect(x starting point, y starting point, width, height, corner radius, color). We could fill in these parameters every time we want to draw a rounded square. But to keep things tidy and clean we will create a struct that holds all the data of our rounded square. We then add a function to draw these elements on our screen. For a full in-depth guide on how this works check out this article.

We draw elements using a coordinate system. The top-left pixel is pixel X0, Y0 on our grid. To make our lives really easy our touch system uses the same coordinates. This means that if we touch the top-left pixel the returned coordinates will be X0, Y0 respectively. There is a minor catch if you rotate the screen in a horizontal mode. The default orientation in the library is the portrait mode. When we rotate the screen the touch coordinates can be flipped on the Y-axis. Our top row will be 320 while our bottom row is 0. There is probably a way to calibrate the screen in the library but since the logic is quite simple we will just apply the flip ourselves. The formula for this is 0 + (maxWidth – the TouchY). If we now touch the top-left pixel the formula become 0 + (320 – 320) = 0. This matches the coordinate system we’ve used to create our buttons.

We could read the raw output of the screen but some debouncing and smoothening can improve your experience by a mile. Luckily the TFT_eSPI library does all the hard work for us. The function tft.getTouch(&t_x, &t_y) returns false if the touch is invalid. If the touch is valid it stores the coordinates at our t_x and t_y coordinates.

Now, what happens with our touch coordinates? When we pass the address of our x and y variables the library checks if the touch is valid. Instead of creating a new temporary variable that contains the touch coordinates, it takes the address we pass, checks if the touch is valid, and directly alters the value saved at our address.

esp32 tft display library factory

In this article, you will learn how to use TFT LCDs by Arduino boards. From basic commands to professional designs and technics are all explained here.

In electronic’s projects, creating an interface between user and system is very important. This interface could be created by displaying useful data, a menu, and ease of access. A beautiful design is also very important.

There are several components to achieve this. LEDs,  7-segments, Character and Graphic displays, and full-color TFT LCDs. The right component for your projects depends on the amount of data to be displayed, type of user interaction, and processor capacity.

TFT LCD is a variant of a liquid-crystal display (LCD) that uses thin-film-transistor (TFT) technology to improve image qualities such as addressability and contrast. A TFT LCD is an active matrix LCD, in contrast to passive matrix LCDs or simple, direct-driven LCDs with a few segments.

In Arduino-based projects, the processor frequency is low. So it is not possible to display complex, high definition images and high-speed motions. Therefore, full-color TFT LCDs can only be used to display simple data and commands.

In this article, we have used libraries and advanced technics to display data, charts, menu, etc. with a professional design. This can move your project presentation to a higher level.

In electronic’s projects, creating an interface between user and system is very important. This interface could be created by displaying useful data, a menu, and ease of access. A beautiful design is also very important.

There are several components to achieve this. LEDs,  7-segments, Character and Graphic displays, and full-color TFT LCDs. The right component for your projects depends on the amount of data to be displayed, type of user interaction, and processor capacity.

TFT LCD is a variant of a liquid-crystal display (LCD) that uses thin-film-transistor (TFT) technology to improve image qualities such as addressability and contrast. A TFT LCD is an active matrix LCD, in contrast to passive matrix LCDs or simple, direct-driven LCDs with a few segments.

In Arduino-based projects, the processor frequency is low. So it is not possible to display complex, high definition images and high-speed motions. Therefore, full-color TFT LCDs can only be used to display simple data and commands.

In this article, we have used libraries and advanced technics to display data, charts, menu, etc. with a professional design. This can move your project presentation to a higher level.

Size of displays affects your project parameters. Bigger Display is not always better. if you want to display high-resolution images and signs, you should choose a big size display with higher resolution. But it decreases the speed of your processing, needs more space and also needs more current to run.

After choosing the right display, It’s time to choose the right controller. If you want to display characters, tests, numbers and static images and the speed of display is not important, the Atmega328 Arduino boards (such as Arduino UNO) are a proper choice. If the size of your code is big, The UNO board may not be enough. You can use Arduino Mega2560 instead. And if you want to show high resolution images and motions with high speed, you should use the ARM core Arduino boards such as Arduino DUE.

In electronics/computer hardware a display driver is usually a semiconductor integrated circuit (but may alternatively comprise a state machine made of discrete logic and other components) which provides an interface function between a microprocessor, microcontroller, ASIC or general-purpose peripheral interface and a particular type of display device, e.g. LCD, LED, OLED, ePaper, CRT, Vacuum fluorescent or Nixie.

The display driver will typically accept commands and data using an industry-standard general-purpose serial or parallel interface, such as TTL, CMOS, RS232, SPI, I2C, etc. and generate signals with suitable voltage, current, timing and demultiplexing to make the display show the desired text or image.

The LCDs manufacturers use different drivers in their products. Some of them are more popular and some of them are very unknown. To run your display easily, you should use Arduino LCDs libraries and add them to your code. Otherwise running the display may be very difficult. There are many free libraries you can find on the internet but the important point about the libraries is their compatibility with the LCD’s driver. The driver of your LCD must be known by your library. In this article, we use the Adafruit GFX library and MCUFRIEND KBV library and example codes. You can download them from the following links.

You must add the library and then upload the code. If it is the first time you run an Arduino board, don’t worry. Just follow these steps:Go to www.arduino.cc/en/Main/Software and download the software of your OS. Install the IDE software as instructed.

By these two functions, You can find out the resolution of the display. Just add them to the code and put the outputs in a uint16_t variable. Then read it from the Serial port by Serial.println(); . First add Serial.begin(9600); in setup().

Upload your image and download the converted file that the UTFT libraries can process. Now copy the hex code to Arduino IDE. x and y are locations of the image. sx and sy are size of the image.

In this template, We converted a .jpg image to .c file and added to the code, wrote a string and used the fade code to display. Then we used scroll code to move the screen left. Download the .h file and add it to the folder of the Arduino sketch.

In this template, We used sin(); and cos(); functions to draw Arcs with our desired thickness and displayed number by text printing function. Then we converted an image to hex code and added them to the code and displayed the image by bitmap function. Then we used draw lines function to change the style of the image. Download the .h file and add it to the folder of the Arduino sketch.

In this template, We created a function which accepts numbers as input and displays them as a pie chart. We just use draw arc and filled circle functions.

while (a < b) { Serial.println(a); j = 80 * (sin(PI * a / 2000)); i = 80 * (cos(PI * a / 2000)); j2 = 50 * (sin(PI * a / 2000)); i2 = 50 * (cos(PI * a / 2000)); tft.drawLine(i2 + 235, j2 + 169, i + 235, j + 169, tft.color565(0, 255, 255)); tft.fillRect(200, 153, 75, 33, 0x0000); tft.setTextSize(3); tft.setTextColor(0xffff); if ((a/20)>99)

while (b < a) { j = 80 * (sin(PI * a / 2000)); i = 80 * (cos(PI * a / 2000)); j2 = 50 * (sin(PI * a / 2000)); i2 = 50 * (cos(PI * a / 2000)); tft.drawLine(i2 + 235, j2 + 169, i + 235, j + 169, tft.color565(0, 0, 0)); tft.fillRect(200, 153, 75, 33, 0x0000); tft.setTextSize(3); tft.setTextColor(0xffff); if ((a/20)>99)

In this template, We display simple images one after each other very fast by bitmap function. So you can make your animation by this trick.  Download the .h file and add it to folder of the Arduino sketch.

In this template, We just display some images by RGBbitmap and bitmap functions. Just make a code for touchscreen and use this template.  Download the .h file and add it to folder of the Arduino sketch.

esp32 tft display library factory

[Adalbert] ran into these problems when he got his hands on a Toshiba T3200SXC from 1991. As the first laptop ever to feature a color TFT display, it’s very much worth preserving as an historical artifact. Sadly, the original display was no longer working: it only displayed a very faint image and went completely blank soon after. Leaky capacitors then destroyed the power supply board, leaving the laptop completely dead. [Adalbert] then began to ponder his options, which ranged from trying to repair the original components to ripping everything out and turning this into a modern-computer-in-an-old-case project.

In the end he went for an option in between, which we as preservationists can only applaud: he replaced the display with a modern one of the correct size and resolution and built a new custom power supply, keeping the rest of the computer intact as far as possible. [Adalbert] describes the overall process in the video embedded below and goes into lots of detail on his hackaday.io page.

Connecting a modern LCD screen was not as difficult as it might seem: where the old display had an RGB TTL interface with three bits per color, the new one had a very similar system with six bits per color. [Adalbert] made an adapter PCB that simply connected the three bits from the laptop to the highest three bits on the screen. A set of 3D-printed brackets ensured a secure fit of the new screen in the classic case.

esp32 tft display library factory

TFT_display_init() Perform display initialization sequence. Sets orientation to landscape; clears the screen. SPI interface must already be setup, tft_disp_type, _width, _height variables must be set.

compile_font_file Function which compiles font c source file to font file which can be used in TFT_setFont() function to select external font. Created file have the same name as source file and extension .fnt

esp32 tft display library factory

LCD Panel IO Operations - provides a set of APIs to operate the LCD panel, like turning on/off the display, setting the orientation, etc. These operations are common for either controller-based LCD panel driver or RGB LCD panel driver.

esp32 tft display library factory

No! For about the price of a familiar 2x16 LCD, you get a high resolution TFT display. For as low as $4 (shipping included!), it"s possible to buy a small, sharp TFT screen that can be interfaced with an Arduino. Moreover, it can display not just text, but elaborate graphics. These have been manufactured in the tens of millions for cell phones and other gadgets and devices, and that is the reason they are so cheap now. This makes it feasible to reuse them to give our electronic projects colorful graphic displays.

There are quite a number of small cheap TFT displays available on eBay and elsewhere. But, how is it possible to determine which ones will work with an Arduino? And what then? Here is the procedure:ID the display. With luck, it will have identifying information printed on it. Otherwise, it may involve matching its appearance with a picture on Google images. Determine the display"s resolution and the driver chip.

Find out whether there is an Arduino driver available. Google is your friend here. Henning Karlsen"s UTFT library works with many displays. (http://www.rinkydinkelectronics.com/library.php?i...)

Download and install the driver library. On a Linux machine, as root, copy the library archive file to the /usr/share/arduino/libraries directory and untar or unzip it.

Load an example sketch into the Arduino IDE, and then upload it to the attached Arduino board with wired-up TFT display. With luck, you will see text and/or graphics.

We"ll begin with a simple one. The ILI9163 display has a resolution of 128 x 128 pixels. With 8 pins in a single row, it works fine with a standard Arduino UNO or with a Mega. The hardware hookup is simple -- only 8 connections total! The library put together by a smart fella, by the name of sumotoy, makes it possible to display text in multiple colors and to draw lines.

Note that these come in two varieties, red and black. The red ones may need a bit of tweaking to format the display correctly -- see the comments in the README.md file. The TFT_ILI9163C.h file might need to be edited.

It is 5-volt friendly, since there is a 74HC450 IC on the circuit board that functions as a level shifter. These can be obtained for just a few bucks on eBay and elsewhere, for example -- $3.56 delivered from China. It uses Henning Karlsen"s UTFT library, and it does a fine job with text and graphics. Note that due to the memory requirement of UTFT, this display will work with a standard UNO only with extensive tweaking -- it would be necessary to delete pretty much all the graphics in the sketch, and just stay with text.

on the far side of the display. It has 220x176 resolution (hires!) and will accept either 3.3 or 5 volts. It will work hooked up to an Uno, and with a few pin changes, also with a Mega. The 11-pin row is for activating the display itself, and the 5-pin row for the SD socket on its back.

This one is a 2.2" (diagonal) display with 176x220 resolution and parallel interface. It has a standard ("Intel 8080") parallel interface, and works in both 8-bit and 16-bit modes. It uses the S6D0164 driver in Henning Karlsen"s UTFT library, and because of the memory requirements of same, works only with an Arduino Mega or Due. It has an SD card slot on its back

This one is a bit of an oddball. It"s a clone of the more common HY-TFT240, and it has two rows of pins, set at right angles to one another. To enable the display in 8-bit mode, only the row of pins along the narrow edge is used. The other row is for the SD card socket on the back, and for 16-bit mode. To interface with an Arduino ( Mega or Due), it uses Henning Karlsen"s UTFT library, and the driver is ILI9325C. Its resolution is 320x240 (hires!) and it incorporates both a touch screen and an SD card slot.

Having determined that a particular TFT display will work with the Arduino, it"s time to think about a more permanent solution -- constructing hard-wired and soldered plug-in boards. To make things easier, start with a blank protoshield as a base, and add sockets for the TFT displays to plug into. Each socket row will have a corresponding row next to it, with each individual hole "twinned" to the adjacent hole in the adjoining row by solder bridges, making them accessible to jumpers to connect to appropriate Arduino pins. An alternative is hard-wiring the socket pins to the Arduino pins, which is neater but limits the versatility of the board.

In step 5, you mention that the TFT01 display can"t be used with the UTFT library on an Arduino Uno because of its memory requirements. It can - all you have to do is edit memorysaver.h and disable any display models you"re not using.

Not at all - it was your Instructable that got me going with the display to begin with! We all build off each other"s work, to the benefit of everyone.0

Tho I realize this is quickly becoming legacy hardware, these 8,16 bit parallel spi with 4 wire controller 3.2in Taft touch display 240x380. It has become very inexpensive with ally of back stock world wide so incorporating them into any project is easier then ever. Sorry to my question. I’m having difficulty finding wiring solution for this lcd. It is a sd1289 3.3 and 5v ,40 pin parallel 8,16 bit. I do not want to use a extra shield,hat or cape or adapter. But there’s a lot of conflicting info about required lvl shifters for this model any help or links to info would be great .. thank you. I hope I gave enough information to understand what I’m adoing

#1 you need a data sheet for the display and pinout and the i/o board attached to the cable.Than before you buy check for a driver for this chip Raydium/RM69071.if no driver lib are you able to write one and do you have the necessary tools to work on this scale to wire it up ..if you answer no than search for an arduino ready product.WCH0

Thanks for the wealth of knowledge! It is amazing at what is possible with items the average person can easily acquire. I hope to put some of your tips to use this winter as I would like to build sensors and other items for home automation and monitoring. Being able to have small displays around the house in addition to gathering and controlling things remotely will help the family see room conditions without going to the computer. The idea of a touchscreen control for cheap is mind blowing.

esp32 tft display library factory

"Upper layer" main development board contains ESP32-PICO-D4 SiP, battery connector & charger circuit with LiPo charge status LEDs, Reset & pull-up IO0 buttons, and a green LED on GPIO4.

Clone of the SparkFun ESP32 Thing board. Compact ESP32 based development board with battery connector, and the typical development board component accoutrements.

The ESP32-LyraTD-MSC Audio-Mic HDK (hardware development kit) combines the ESP32-LyraTD-MSC ("audio-mic development board") with a secondary "top" board.

The ESP32 touch sensor development kit, ESP32-Sense Kit, is used for evaluating and developing ESP32 touch sensor system. ESP32-Sense Kit consists of one motherboard and multiple daughterboards. The motherboard contains a display unit, a main control unit and a debug unit. The daughterboards have touch electrodes in different combinations or shapes, such as linear slider, wheel slider, matrix buttons and spring buttons, depending on the application scenarios. Users can design and add their own daughterboards for special usage cases.

ESP-WROOM-32 based development board with SH1106 OLED display (128×64 pixels), RJ-45 Ethernet connector, CAN-bus connector, Micro USB connector, USB-to-UART bridge, LiPo battery connector and charging circuit.

ESP32 development board with ePaper display, TI PCM5102A DAC, ICS43434 MEMS Microphone, CP2102N USB-to-UART bridge, microSD card slot, and LiPo charger.

esp32 tft display library factory

It is satisfying to display color pictures onto screens attached to an ESP32 microcontroller. Program memory in these microprocessor chips is large enough (4 MB) to contain color images. The two-core processor is lightning fast compared with the Arduino Uno.

In the present project we first convert color pictures into c-array format. These arrays are either included in a sketch or saved in a separate file that is called via an instruction in a sketch. Both methods produce the same result when the sketch is uploaded to the micrcoontroller: the c-array is loaded in program memory. Displays are 320*240 pixel and 320*480 pixel TFT breakout screens with controllers such as ILI9341, ILI9481, ILI9488. Interfaces are either SPI or parallel. These TFT displays have for each pixel 65,536 colors available (16 bits per pixel, RGB565), while their controllers are perfectly supported by the library TFT_eSPI.h created by Bodmer.

TFT type screens offer the luxury of nearly unlimited color compared with LCDs and OLEDs. We are all aware that graphical representation of data benefits greatly from color enhancement. Almost by default new users of TFT screens look for a library supporting graphical functions in color: pixels, lines, circles, triangles and so forth. As a color image is for a microcontroller no more than an immense bunch of colored pixels in which each pixel is one ‘graphic’, any TFT display should be able to show color pictures.

With a TFT display images can be presented as colorful as on your smartphone. Of course a smartphone screen has far more pixels than the humble 320*480, which necessitates some reduction in color depth, some cropping and some scaling. In this project I started with a big, 2521*1688 pixel, 24 bit color depth, jpg image downloaded from Wikipedia.

To possess a TFT screen is one thing, making it work, that is: showing color pictures, is a small challenge that needs some investment in ideas, time and effort. The selection of a competent supporting library is of prime importance. Another issue is the communication between microcontroller and display. Among the available libraries the TFT_eSPI.h library offers superior support for a variety of controllers / microcontroller board / TFT display configurations, including the configuration used in the current project. TFT_eSPi supports displays with SPI interface but also those with parallel interfaces. Special controllers, e.g. ILI9488, need special libraries, e.g. variations of the Adafruit_GFX library

• display: most experimentation was done with 3.5’ 320*480 pixel SPI or parallel TFT breakout boards, operating at 3.3V (control logic wires) and 5V (backlight). The display ‘on bench’ in Figure 1 is a 3.95 inch MCUfriend 320*80 display with parallel interface originally applied as an Arduino Uno shield.

• library: the TFT_eSPI.h library ensemble created by Bodmer was used with success for most displays and controllers. This library has interesting options for custom configuration and tweaking – a necessary feature!

TFT_eSPI can be installed via the Library Manager in the Arduino IDE (Tools → Manage Libraries). Additional Configuration: see section ‘Software: library issues’. Install the most recent version.

In order to avoid struggling with masses of stiff Dupont jumper wires I constructed two permanent benches with soldered wires and with pin sockets that accomodate the microcontroller board and various displays: one that supports TFT breakout boards with parallel interface (fig. 1) and one that supports TFT breakouts with SPI interface (fig 2). The construction of both benches is described in detail in posts published previously on this website (*),(**).

Whereas the display controller can be the same the interface between the display and the microcontroller may differ. Parallel displays have eight pins (labeled D0 through D7) that transfer signals to the display in addition to clock, chip select, read, write and reset pins. This occupies a total of 13 pins of the microcontroller board. SPI communication uses only 6 pins for control signals and data between the microcontroller and the display (figure 3).

The essential content from the c-array file (‘rocks_02.c’) is copy-pasted into a unsigned 16-bit variable with the name ‘rocks_02’, at the beginning of the sketch (fig. 6). Notice that ESP32 instructions do not need the PROGMEM statement as for the Arduino Uno. The ESP has plenty of memory!

While TFT_eSPI is a versatile library it needs some explanation. Conventional display support libraries require a ‘constructor’ line inside a sketch. This configuration formula contains a definition of the type of display and pin assignments. In the TFT_eSPI environment a file named User_Setup.h replaces the ‘constructor’ of the conventional sketch, and the only thing a sketch has to do is to call the TFT_eSPI library. This approach makes it possible to switch display very easy, e.g., between parallel and SPI display. The essence of working with TFT_eSPI.h is therefore first to instruct the library once and for all to use User_Setup.h tweaked for your particular display, and second to prepare a User_Setup.h that fits your display. The second step is most challenging. Fortunately the library suite provides numerous helpful examples.

in User_Setup_Select.h uncomment the line referring to a specific example file in the folder User_Setup that matches your microcontroller/display combination.

Both methods: internal c-array or external c-array, worked fine. Various TFT displays available in my collection were tested. These had different controllers, but with the exception of a 3.95’ 320*480 SPI display with a semi-compatible ILI9488 controller all were easy to work with. The TFT_eSPI library includes User_setups that with a little tweaking can be adjusted to work with a specific microcontroller-display size- interface-controller type. The creator of TFT_eSPI has done a extremely good job in supplying support for several microcontrollers (Arduino, ESP8266, ESP32, STM32), parallel or SPI interface, and common display controller chip (e.g. ST7735, ST7789, ST7796, ILI9341, ILI9163, ILI9481, ILI9486, ILI9488).

All 320*240 displays gave good results when there were 320*480 c-arrays in their sketches, that is, the left upper parts of 320*480 size images were visible on screen. Thus it is possible with ESP32 microcontrollers to show large images on small displays. If one wants to see an entire 320*480 image on a 320*240 display, then the original BMP image must be scaled down to 320*240 in a bitmap editor and again processed with lcd-image-converter into a 320*240 c-array. A 320*240 c-array displayed on a 320*480 screen will occupy half the screen.

The ‘obnoxious’ 3.95’ 320*480 display appeared to be a touch-sensitive display without touch with a strange, possible counterfeit controller. As extensive tweaking of the TFT_eSPI library User_setups did not much to produce a clean image I experimented in this case with a series of instructions combined with the LovyianGFX library. This completed the job successfully.