Posts

Showing posts from 2025

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

Local-host DeepSeek-R1 on Android Phone, Poco F7 Pro, using Termux+Ollama.

Image
This video show steps to host DeepSeek-R1 on Android Phone locally, using Termux+Ollama. Tested on Poco F7 Pro. Basic steps: Download and install F-Droid, an installable catalogue of FOSS (Free and Open Source Software) applications for the Android platform. https://f-droid.org/ Install Termux (a Terminal emulator with packages) in F-Droid. Run Termux To grant right to Termux to access storage. termux-setup-storage Change repo, it will improve download greatly. termux-change-repo Update and upgrade. pkg update -y && pkg upgrade -y Install necessary software: pkg install git cmake golang proot-distro -y Install Ubuntu: proot-distro install ubuntu Login Ubuntu: proot-distro login ubuntu Install Ollama: curl -fsSL https://ollama.com/install.sh | sh Run Ollama server in background, you have to press [ENTER] to return to command line: ollama serve & Pull deepseek-r1:1.5b to local: ollama pull deepseek-r1:1.5b Once deepseek-r1:1.5b pulle...

ESP32S3 (Arduino framework) decode jpg and display on ST7789 SPI Display.

Image
Base on former exercise of " 240x240 ST7789V2 SPI IPS with FT6236 cap touch on XIAO ESP32S3 using GFX Library for Arduino ", this exercise run on XIAO ESP32S3 Sense in Arduino framework, load jpg from SD, decode the jpg using JPEGDEC library, and display on  1.54 inch 240x240 ST7789V2 SPI IPS with FT6236 cap touch using GFX Library for Arduino (Arduino_GFX_Library). Connection follow the former exercise . Install the following libraries in Arduino IDE's Library Manager. - GFX Library for Arduino (Arduino_GFX_Library) for display on ST7789 - JPEGDEC for jpg decoding Exercise code: XiaoS3_ST7789_SD_jpg_scale.ino /******************************************************************************* Xiao ESP32S3 Sense exercise Display jpg on 240x240 ST7789 SPI IPS - Display jpg in various scale. Libraries needed (available in Arduino IDE Library Manager): - GFX Library for Arduino (Arduino_GFX_Library) for display on ST7789 - JPEGDEC for jp...

ESP32-P4-EYE

Image
  ESP32-P4-EYE ~ ESP32-P4-EYE User Guide

Xiao ESP32S3 Sense read MicroSD

Image
Exercise run on  Xiao ESP32S3 Sense in Arduino framework, read SD Card. Base on the exercise " 240x240 ST7789V2 SPI IPS with FT6236 cap touch on XIAO ESP32S3 using GFX Library for Arduino ", display ST7789 LCD. XiaoS3_ST7789_SD.ino , read and display SD info and hello.txt content. /******************************************************************************* Xiao ESP32S3 Sense exercise ******************************************************************************/ /******************************************************************************* * Start of Arduino_GFX setting ******************************************************************************/ #include <Arduino_GFX_Library.h> //=== Custom to match my connection =========================================== #define PIN_BLK 4 #define PIN_CS 3 #define PIN_DC 2 #define PIN_RES 1 #define PIN_SDA 9 #define PIN_SCL 7 #define GFX_BL PIN_BLK #define CTP_INT 43 #define CTP_RST 44 #define FT6236_AD...

Arduino_GFX_Library + LVGL on ESP32S3 + ST7789 SPI IPS with FT6236 cap touch, create button to toggle onboard LED

Image
Last exercise on Xiao ESP32S3 Sense, to display on 240x240 ST7789V2 SPI IPS using Arduino_GFX_Library, and interface FT6236 cap touch using Wire I2C, in Arduino framework . This exercise add function of LVGL. Connection , following in last exercise . Preparation: - Install GFX Library for Arduino in Arduino IDE Library Manager,   follow last exercise , make sure both ST7789 and FT6236 works. - Install LVGL library in Arduino IDE Library Manager.   Using LVGL with Arduino requires some extra steps:   *Be sure to read the docs here: https://docs.lvgl.io/master/get-started/platforms/arduino.html   Copy lv_conf_template.h in lvgl library directory, rename as lv_conf.h and save into the Arduino Libraries directory. To enable the content of the file, change the first #if 0 to #if 1. #if 1 //0 /*Set it to "1" to enable content*/ Exercise code: XIAOS3_ST7789_FT6236_LVGL_Arduino_v9.ino , my exercise to create a button to toggle the ...

240x240 ST7789V2 SPI IPS with FT6236 cap touch on XIAO ESP32S3 using GFX Library for Arduino

Image
My exercise on  Seeed Studio XIAO ESP32S3 Sense (Arduino framework) to display on  1.54 inch 240x240 ST7789V2 SPI IPS with FT6236 cap touch . ST7789 Display part using GFX Library for Arduino FT6236 Cap touch part read via I2C (Wire) Connection: ST7789V2 -------- 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 Exercise Code: XS3_ST7789_GFX_color_touch.ino /* XIAO ESP32S3 display on 240x240 ST7789 SPI IPS with FT6236 cap touch using GFX Library for Arduino - Color and Touch Test Arduino_GFX https://github.com/moononournation/Arduino_GFX Connection: ST7789V2 -------- GND GND VCC 3V3 SCL GPIO7 SDA GPIO9 RES GPIO1 DC GPIO2 CS GPIO3 BLK GPIO4 FT6236 ------ SCL GPIO6 SDA GPIO5 INT Not use RST GPIO44 */ #include <Arduino_GFX_Library.h> #include <Wire.h> /...

1.54 inch 240x240 ST7789V2 SPI IPS with FT6236 cap touch

Image
1.54 inch 240x240 ST7789V2 SPI IPS with FT6236 cap touch Exercise: ~  240x240 ST7789V2 SPI IPS with FT6236 cap touch on XIAO ESP32S3 using GFX Library for Arduino ~  Arduino_GFX_Library + LVGL on ESP32S3 + ST7789 SPI IPS with FT6236 cap touch, create button to toggle onboard LED ~  ESP32S3 (Arduino framework) decode jpg and display on ST7789 SPI Display . ~  Xiao ESP32S3 display on 240*240 ST7789 SPI LCD/FT6236U cap. touch using TFT_eSPI in Arduino Framework . ~  TFT_eSPI + LVGL on Xiao ESP32S3 + ST7789 SPI IPS with FT6236 cap touch .

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