From 9b3a23adde0c18d08dd76ddbea2751b7bbbcf201 Mon Sep 17 00:00:00 2001 From: Ricard Bitria Ribes Date: Sat, 8 Feb 2020 13:55:35 +0100 Subject: [PATCH] Updated Installing TFT_eSPI on PlatformIO (markdown) --- Installing-TFT_eSPI-on-PlatformIO.md | 60 ++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/Installing-TFT_eSPI-on-PlatformIO.md b/Installing-TFT_eSPI-on-PlatformIO.md index 47e8975..b69bb41 100644 --- a/Installing-TFT_eSPI-on-PlatformIO.md +++ b/Installing-TFT_eSPI-on-PlatformIO.md @@ -27,13 +27,65 @@ We can achieve this by using PlatformIO's [`build_flags`](https://docs.platformi Your code now looks like this: ```INI build_flags = - ;############################################################### - ; TFT_eSPI library setting here (no need to edit library files): - ;############################################################### - -D USER_SETUP_LOADED=1 ; Set this settings as valid + -D USER_SETUP_LOADED=1 -include $PROJECT_LIBDEPS_DIR/$PIOENV/TFT_eSPI_ID1559/User_Setups/Setup1_ILI9341.h ``` +- Optionally you can create your custom setup by defining the needed settings, here is an example: +```INI + -D ILI9163_DRIVER=1 ; Select ILI9163 driver + -D TFT_WIDTH=128 ; Set TFT size + -D TFT_HEIGHT=160 + -D TFT_MISO=19 ; Define SPI pins + -D TFT_MOSI=23 + -D TFT_SCLK=18 + -D TFT_CS=5 + -D TFT_DC=19 ; Data/Comand pin + -D TFT_RST=-1 ; Reset pin + -D LOAD_GLCD=1 ; Load Fonts + -D SPI_FREQUENCY=27000000 ; Set SPI frequency +``` +*** +The final `platformio.ini` file may look like this: +- Using User_Setups: + ```INI + [env:esp32dev] + platform = espressif32 + board = esp32dev + framework = arduino + lib_deps = TFT_eSPI + build_flags = + ;############################################################### + ; TFT_eSPI library setting here (no need to edit library files): + ;############################################################### + -D USER_SETUP_LOADED=1 ; Set this settings as valid + -include $PROJECT_LIBDEPS_DIR/$PIOENV/TFT_eSPI_ID1559/User_Setups/Setup1_ILI9341.h + ``` +- Custom setup: + ```INI + [env:esp32dev] + platform = espressif32 + board = esp32dev + framework = arduino + lib_deps = TFT_eSPI + build_flags = + ;############################################################### + ; TFT_eSPI library setting here (no need to edit library files): + ;############################################################### + -D USER_SETUP_LOADED=1 ; Set this settings as valid + -D ILI9163_DRIVER=1 ; Select ILI9163 driver + -D TFT_WIDTH=128 ; Set TFT size + -D TFT_HEIGHT=160 + -D TFT_MISO=19 ; Define SPI pins + -D TFT_MOSI=23 + -D TFT_SCLK=18 + -D TFT_CS=5 + -D TFT_DC=19 ; Data/Comand pin + -D TFT_RST=-1 ; Reset pin + -D LOAD_GLCD=1 ; Load Fonts + -D SPI_FREQUENCY=27000000 ; Set SPI frequency + ``` + ### 5. Include header Add the line `#include `at the top of your files.