Drawing Pad With ESP32

I made a random - colored drawing pad. It uses dots (filled 1px circles) to draw. I also made a clear button to go with it.
Why I made this project: In my opinion, I think TFTs are very beautiful - the abilities to draw, use the touchscreen and have color. So when I got this product I made a touchscreen project that has a clear button, ablitiy to write on it and picks a random of 23 colors.
Supplies


- Hosyond SPI TFT (any size - less the size, more money not wasted) - get on Amazon (ILI9341 is used)
- ESP32 DEV - get on Amazon
- Breadboard
- Wires(14)
The Wire Connections
We are connecting the TFT to the ESP32 using a breadboard and wires.
The connections might be hard or easy for you:
TFT ----------------------------- ESP32
- VCC >> 3.3V OR 5V
- GND >> GND
- CS >> pin 15 (chip select)
- RESET >> pin 4 (reset)
- DC / RS >> pin 13 (control)
- SDI >> pin 23 (MOSI)
- SCK >> pin 18 (Serial Clock)
- LED >> 3.3V or pin 5
- SD0 >> pin 19 (MISO)
- T_CLK >> pin 12 (touch clock)
- T_CS >> pin 14 (touch chip select)
- T_DIN >> pin 27
- T_DO >> pin 26
- T_IRQ >> pin 33 or 25
the sign '>>' are indicators to connect which pin to which pin using wires.
Coding the ESP32


Go to Arduino IDE app then install libraries by going to Tools > Library Manager then type in XPT2046_Touchscreen, SPI, Adafruit_GFX and Adafruit_ILI9341.
Then write this code:
Downloads
Upload the Code

.png)
Press the Upload button (or press Verify then Upload), plug in your ESP32, set your board up , and see it happen on the TFT!
What If It Doesn't Work?
If your project doesn't work,
- Check your wiring - This also solved my problems. (Connecting the TFT is very hard.)
- If you have a different type then please ask for another code or wiring.
- If a tutorial came - I recommend you to read it.
HAPPY CODING!