Posts

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 ...

CircuitPython to control ESP32-H2-DevKitM-1-N4 onboard RGB LED

Image
CircuitPython 10.0.3 code to control  ESP32-H2-DevKitM-1-N4 onboard RGB LED. import os, sys print("=========================================") print(sys.implementation[0], os.uname()[3], "\nrun on", os.uname()[4]) print("=========================================") import time import neopixel import board def cycleNeopixel(wait): for r in range(255): pixel[0] = (r, 0, 0) time.sleep(wait) for r in range(255, 0, -1): pixel[0] = (r, 0, 0) time.sleep(wait) for g in range(255): pixel[0] = (0, g, 0) time.sleep(wait) for g in range(255, 0, -1): pixel[0] = (0, g, 0) time.sleep(wait) for b in range(255): pixel[0] = (0, 0, b) time.sleep(wait) for b in range(255, 0, -1): pixel[0] = (0, 0, b) time.sleep(wait) print("to control onboard RGB NeoPixel") print("neopixel version: " + ...

Control onboard RGB LED of Waveshare ESP32-H2-Zero and ESP32-H2-DevKitM-1-N4, in Arduino framework.

Image
Following code control the onboard RGB LED of Waveshare ESP32-H2-Zero and ESP32-H2-DevKitM-1-N4 , in Arduino framework. H2_BlinkRGB.ino /* H2_BlinkRGB */ void setup() { // No need to initialize the RGB LED } // the loop function runs over and over again forever void loop() { // * notice the color order rgbLedWrite(RGB_BUILTIN, RGB_BRIGHTNESS, 0, 0); // Red delay(1000); rgbLedWrite(RGB_BUILTIN, 0, RGB_BRIGHTNESS, 0); // Green delay(1000); rgbLedWrite(RGB_BUILTIN, 0, 0, RGB_BRIGHTNESS); // Blue delay(1000); rgbLedWrite(RGB_BUILTIN, 0, 0, 0); // Off / black delay(1000); int fade_speed = 10; for(int i=0; i<=255; i++){ rgbLedWriteOrdered(RGB_BUILTIN, LED_COLOR_ORDER_RGB, i, 0, 0); // Red delay(fade_speed); } for(int i=255; i>=0; i--){ rgbLedWriteOrdered(RGB_BUILTIN, LED_COLOR_ORDER_RGB, i, 0, 0); // Red delay(fade_speed); } for(int i=0; i<=255; i++){ rgbLedWriteOrdered(RGB_BUILTIN, LED_COLOR_ORDER_RGB, 0, i,...

My dev.board: ESP32-H2-DevKitM-1-N4

Image
 My dev.board: No brand ESP32-H2-DevKitM-1-N4 development board. Related links: ~ Espressif  ESP32-H2-DevKitM-1 Arduino Exercises: ~  Control onboard RGB LED of Waveshare ESP32-H2-Zero and ESP32-H2-DevKitM-1-N4, in Arduino framework . CircuitPython Exercises: ~  CircuitPython to control ESP32-H2-DevKitM-1-N4 onboard RGB LED ~  ESP32-H2-DevKitM-1-N4/CircuitPython display on WaveShare 3.5 inch ST7796S SPI LCD

My dev.board: Waveshare ESP32-H2-Zero

Image
 My dev. Board:  Waveshare ESP32-H2-Zero ~ Product link:  Waveshare ESP32-H2-Zero Exercises: ~  Control onboard RGB LED of Waveshare ESP32-H2-Zero and ESP32-H2-DevKitM-1-N4, in Arduino framework .

TFT_eSPI + LVGL on Xiao ESP32S3 + ST7789 SPI IPS with FT6236 cap touch.

Image
To implement TFT_eSPI + LVGL on Xiao ESP32S3 + ST7789 SPI IPS with FT6236 cap touch. First, follow previous exercise Xiao ESP32S3 display on 240*240 ST7789 SPI LCD/FT6236U cap. touch using TFT_eSPI in Arduino Framework , make sure both ST7789 and FT6236 works using TFT_eSPI library. Install LVGL library in Arduino IDE Library Manager. Follow the video to prepare lv_conf.h file. Then you can try LVGL example: > File > Examples > lvgl > arduino > LVGL_Arduino My example codes: XS3_ST7789_TFT_eSPI_lvgl.ino Create a button to toggle onboard LED. /* TFT_eSPI + LVGL exercise run on Xiao ESP32S3 + 1.54" 240x240 ST7789V2 SPI IPS with FT6236 cap touch Create a button to toggle onboard LED. https://coxxect.blogspot.com/2025/10/tftespi-lvgl-on-xiao-esp32s3-st7789-spi.html modified from Examples > lvgl > arduino > LVGL_Arduino Library needed: - TFT_eSPI - LVGL Preparation: - Prepare TFT_eSPI in Arduino ...

Xiao ESP32S3 display on 240*240 ST7789 SPI LCD/FT6236U cap. touch using TFT_eSPI in Arduino Framework.

Image
This video show steps how Xiao ESP32S3 display on 1.54" 240*240 ST7789 SPI LCD using TFT_eSPI in Arduino Framework. Connection: ST7789V2 Xiao ESP32S3 ---------------------------- GND GND VCC 3V3 SCL GPIO7 SDA GPIO9 RES GPIO1 DC GPIO2 CS GPIO3 BLK GPIO4 FT6236 ---------------------------- SCL GPIO6 SDA GPIO5 INT GPIO43 (Not used) RST GPIO44 Library used: TFT_eSPI  https://github.com/Bodmer/TFT_eSPI To setup, scroll down to "Tips" section: Create a new folder in your Arduino library folder called "TFT_eSPI_Setups". You then place your custom setup.h files in there. Edit the User_Setup_Select.h file to point to your custom setup file. Create my custom setup file, Setup_ST7789_XIAOESP32S3.h , under TFT_eSPI_Setups folder. // Setup_ST7789_XIAOESP32S3.h in // ..\Arduino\libraries\TFT_eSPI_Setups\ // // Modify // ..\Arduino\libraries\TFT_eSPI\User_Setup_Select.h to load it. // #include <../TFT_eSPI_Setups/Setup_ST7789_XIAOESP32S3.h> #de...