Posts

Showing posts with the label display ST7796 SPI

1.54" 320x320 ST7796 SPI IPS on Waveshare ESP32-H2-Zero/CircuitPython 10.0.3

Image
1.54" 320x320 ST7796 SPI IPS on Waveshare ESP32-H2-Zero /CircuitPython 10.0.3 Currently, no official ST7796 library for CircuitPython, so we have to implement my custom ST7796_INIT_SEQUENCE and busdisplay.BusDisplay(). cpy_H2Zero_st7796_320x320.py , simple color test. """ Waveshare ESP32-H2-Zero/CircuitPython display on 1.54 inch 320x320 ST7796 SPI IPS 320x320 ST7796 LCD ESP32-H2-Zero - BL -----+ +-----=======-----+ 3V3 ---+ | |5V GPIO24| GND ---|-|-------------|GND GPIO23| +-|-------------|3V3 GPIO25| +-------------|GPIO0 GPIO22| CS -------------------|GPIO1 GPIO14| SCK -------------------|GPIO2 GPIO13| DC -------------------|GPIO3 GPIO12| MOSI -------------------|GPIO4 GPIO11| |GPIO5 GPIO10| +-----------------+ CircuitPython Libraries ...

my display module: 1.54" 320x320 ST7796 SPI IPS (TK015F4000)

Image
1.54" 320x320 ST7796 SPI IPS (TK015F4000) CircuitPython exercise: ~  1.54" 320x320 ST7796 SPI IPS on Waveshare ESP32-H2-Zero/CircuitPython 10.0.3

ESP32-H2-DevKitM-1-N4/CircuitPython display on WaveShare 3.5 inch ST7796S SPI LCD

Image
ESP32-H2-DevKitM-1-N4 /CircuitPython display on WaveShare 3.5 inch ST7796S SPI LCD . cpyH2_ST7796.py, color test and simple text. """ ESP32-H2-DevKitM-1-N4/CircuitPython display on WaveShare 3.5 inch ST7796S SPI LCD Connection: VCC 3.3V 3V3 No Connection GND GND MISO IO3 MOSI IO5 SCLK IO4 SD_CS IO2 LCD_CS IO1 LCD_DC IO0 LCD_RST IO10 LCD_BL IO11 TP_SDA TP_SCL TP_INT TP_RST """ import os, sys import time import board import displayio import busio import fourwire import busdisplay from adafruit_display_text import label import terminalio spi_mosi = board.IO5 spi_sclk = board.IO4 sd_cs = board.IO2 lcd_cs = board.IO1 lcd_dc = board.IO0 lcd_rst = board.IO10 lcd_bl = board.IO11 DISPLAY_width = 480 DISPLAY_height = 320 ST7796_INIT_SEQUENCE = ( b"\x01\x80\x96" # _SWRESET and Delay 150ms b"\x11\x80\x78" # SLPOUT b"\x36\x01\x48" # b"\x36\x01\x08" # MADCTL ...

LVGL on Raspberry Pi Pico 2 (Arduino framework/arduino-pico) with 320x480 TFT SPI ST7796 + FT6336U Capacitive Touch

Image
LVGL (Light and Versatile Graphics Library) is a popular free and open-source embedded graphics library to create beautiful UIs for any MCU, MPU and display type, supports working with the TFT_eSPI library. Following previous exercise " Raspberry Pi Pico 2 drive 4.0" 320x480 TFT SPI ST7796 with FT6336U Capacitive Touch + SD, in Arduino framework ", this exercise show steps to add LVGL on top of TFT_eSPI, on Raspberry Pi Pico 2. Install lvgl library in Arduino IDE's Library Manager. Using LVGL with Arduino requires some extra steps: Be sure to read the docs here: https://docs.lvgl.io/master/integration/framework/arduino.html Follow these configuration steps: - Go to the directory of the installed Arduino libraries - Go to lvgl and copy lv_conf_template.h as lv_conf.h into the Arduino Libraries directory next to the lvgl library folder. - Open lv_conf.h and change:   To enable the content of the file:   change the first #if 0 to #if 1   To use T...

Raspberry Pi Pico 2 drive 4.0" 320x480 TFT SPI ST7796 with FT6336U Capacitive Touch + SD, in Arduino framework

Image
Exercise of Raspberry Pi Pico 2 (in Arduino framework) to drive  4.0" 320x480 TFT SPI ST7796 with FT6336U Capacitive Touch + SD . The Raspberry Pi Pico 2 are programmed in Arduino framework using board of  Raspberry Pi Pico/RP2040/RP2350 by Earle F. Philhower, III (arduino-pico) , load bmp images from SD card, display on ST7796 using  TFT_eSPI , and touch screen to switching among images. Connection: ST7796 Module Raspberry Pi Pico 2 --------------------------------------- SD_CS GP15 CTP_INT not used CTP_SDA GP4 CTP_RST GP14 (optional, or 3V3) CTP_SCL GP5 SDO(MISO) GP16 LED GP22 SCK GP18 SDI(MOSI) GP19 LCD_RS GP21 LCD_RST GP20 LCD_CS GP17 GND GND VCC VBUS (5V) This ST7796 display module have on board level conversion circuit, compatible with 5V and 3.3V MCU. According LCDWiKi 4.0inch Capacitive SPI Module ST7796 , VCC is recommended to connect to 5V. When connected to 3.3V, the backlight brightness will be s...

my display module: 4.0" 320x480 TFT SPI ST7796 with FT6336U Capacitive Touch

Image
 4" 320*480 ST7796 SPI TFT with SD and FT6336U capacitive touch. ~ Product page:  4.0inch Capacitive SPI Module ST7796 Related Exercises: ~  Raspberry Pi Pico 2 drive 4.0" 320x480 TFT SPI ST7796 with FT6336U Capacitive Touch + SD, in Arduino framework . ~  LVGL on Raspberry Pi Pico 2 (Arduino framework/arduino-pico) with 320x480 TFT SPI ST7796 + FT6336U Capacitive Touch

CircuitPython on Pico 2 + Touch LCD, act as a HID mouse.

Image
Refer to the cpy_pico2_st7796_BusDisplay_FT6336.py exercise in last post " Use ST7796 SPI LCD on CircuitPython/Raspberry Pi Pico 2, by instancing BusDisplay object using custom init_sequence ", It simple read touch reported by adafruit_focaltouch and display a cursor on screen, no any actual function. In this exercise I will add a simple handler to detect touch action such as touch-down, touch-up, and touch-move, and finally report to PC as HID mouse function. Connection, refer to last post " Use ST7796 SPI LCD on CircuitPython/Raspberry Pi Pico 2, by instancing BusDisplay object using custom init_sequence ". To install libraries for following exercise using circup: circup install adafruit_display_text adafruit_focaltouch adafruit_hid adafruit_button Exercise Code: cpy_pico2_st7796_BusDisplay_FT6336_handler.py Before we report HID mouse function, we have to detect touch action touch-down, touch-up, and touch-move. In this code, a ...