Example sketch for six different boat gauges namely:
- Coolant pressure (psi)
- Coolant temp (degree C)
- Oil pressure (psi)
- Speedo (km/h)
- Tacho (rpm)
- Battery voltage
For live demonstration visit [https://www.youtube.com/watch?v=y_H7HM0oyoo]
- Install ESP32 boards library guide from randomnerdtutorials
- Install TFT_eSPI library by Bodmer through Library Manager (Sketch > Include Library > Manage Libraries or Ctrl+Shift+l)
Open ..\Documents\Arduino\libraries\TFT_eSPI\User_Setup.h
and comment out line 44:
//#define ILI9341_DRIVER
On line 64 uncomment GC9A01 driver:
#define GC9A01_DRIVER
Open ..\Documents\Arduino\libraries\TFT_eSPI\User_Setup_Select.h
and comment out line 24:
//#include <User_Setups/Setup1_ILI9341.h>
On line 105 uncomment GC9A01 setup:
#include <User_Setups/Setup200_GC9A01.h>
Open ..\Documents\Arduino\libraries\TFT_eSPI\User_Setups\Setup200_GC9A01.h
and update pin assignments:
#define TFT_MISO 5
#define TFT_MOSI 2
#define TFT_SCLK 15 // Clock pin
#define TFT_CS 17 // Chip select control pin
#define TFT_DC 16 // Data Command control pin
#define TFT_RST 4 // Reset pin (could connect to Arduino RESET pin)
Image is courtesy of WOKWI.com and some MS Paint work
ESP32 GC9A01
3V3 VCC
GND GND
D15 SCL
D2 SDA
D4 RES
RX2 DC
TX2 CS
D5 BLK