Tuesday, January 5, 2021

ESP32 + 2.4" 320X240 Display (SPI ILI9341), using TFT_eSPI, prepare user setup file.

Install TFT_eSPI library in Arduino IDE Library Manager.

Reading the TFT_eSPI GitHub page, if you update TFT_eSPI then it will over-write your setups if they are kept within the TFT_eSPI folder. It's suggested to create a new folder in your Arduino library folder called "TFT_eSPI_Setups". You then place your custom setup.h files in there. After an upgrade simply edit the User_Setup_Select.h file to point to your custom setup file.

Here is how to prepare my custom setup file for using SPI ILI9341 on ESP32 (NodeMCU-32S).

- Create a new folder in your Arduino library folder called "TFT_eSPI_Setups"

- Copy default User_Setup.h (checked it match with using SPI ILI9341) to "TFT_eSPI_Setups" folder, rename it if you want.


- Edit the User_Setup_Select.h file to point to the custom setup file.


- Edit the custom user setup file:

ILI9341_DRIVER is selected by default, keep it no change.


Comment and un-comment the pin assignment code as shown:

3 comments:

  1. Hi
    thnak you very much
    But why do you not uncomment the 19 (MISO) ?

    ReplyDelete
  2. First, thanks for the tutorial.
    For each sketch, is it necessary to create a folder "TFT_eSPI_Setups" with a custom file inside this folder?

    ReplyDelete
    Replies
    1. If your sketches have same pins/IO assigned, you can share the same User_Setup_xxx.h in "TFT_eSPI_Setups" folder. If you have different pins/IO assignment, you can create other User_Setup_yyy.h in the same "TFT_eSPI_Setups" folder.

      Delete