Posts

Showing posts with the label code.CircuitPython

Raspberry Pi Pico 2 W/CircuitPython 10.0.3: Load animated GIFs from MicroSD, display them on a 240*240 GC9A01 LCD using gifio.OnDiskGif.

Image
Previous posts show Basic setup of 1.28 inch 240x240 Round Display with GC9A01 SPI on Raspberry Pi Pico 2 W/CircuitPython 10.0.3  and display bmp images from SD using displayio.OnDiskBitmap()/adafruit_imageload.load()  This post shows how to display animated GIFs from MicroSD. The connection between Raspberry Pi Pico 2 W, GC9A01 LCD and the MicroSD Module refers to the last post, display bmp images from SD using displayio.OnDiskBitmap()/adafruit_imageload.load()   Ref: https://docs.circuitpython.org/en/latest/shared-bindings/gifio/index.html#gifio.OnDiskGif Exercise Code: cpy_rpPicoW_gc9a01_sd_OnDiskGif.py. Cooperate with displayio, this mode is relatively slow. """ Raspberry Pi Pico 2 W/CircuitPython 10.0.3 with 1.28" 240x240 Round GC9A01 SPI IPS LCD Display animated GIF in SD, using gifio.OnDiskGif. Cooperate with displayio, this mode is relatively slow. https://coxxect.blogspot.com/2026/02/raspberry-pi-pico-2-wcircuitpython-1003.html ref: https:...

Pico 2 W/CircuitPython 10.0.3 Display bmp images in SD, using displayio.OnDiskBitmap()/adafruit_imageload.load().

Image
Raspberry Pi Pico 2 W with CircuitPython 10.0.3, to display BMP images from an MicroSD card on a 240*240 GC9A01 Round LCD , using displayio.OnDiskBitmap() and adafruit_imageload.load(). Reference: -  displayio.OnDiskBitmap() -  adafruit_imageload.load() All bmp were resized and converted from jpg to 240*240 RGB888 bmp using FFmpeg . Connection: Raspberry Pi Pico 2 W ===================== GP28| GND | GP27| GP26| Run | GP22| ------- LCD_BLK ------------+ GND | | GP21| ------- LCD_DC ---------+ | GP20| ------- LCD_RES-------+ | | +------- SD_MISO|GP12 GP19| MOSI - SPI_SDA ----+ | | | | +----- SD_CS |GP13 GP18| SCK - SPI_SCL --+ | | | | | | |GND GND | | | | |...

CircuitPython to list files in SD

Image
CircuitPython exercise to list files in SD Connection: Raspberry Pi Pico 2 W ===================== GP28| GND | GP27| GP26| Run | GP22| GND | GP21| GP20| +------- SD_MISO|GP12 GP19| | +----- SD_CS |GP13 GP18| | | |GND GND | | | +--- SD_SCK |GP14 GP17| | | | +- SD_MOSI|GP15 GP16| | | | | +---------------+ | | | | | | | | SD Module | | | | ========= | | | | GND --- GND +-|-|-|-------- MISO | +-|-------- CLK | +-------- MOSI +------------ CS 3V3 --- 3V3 Exercise Code: cpy_rpPicoW_sd.py """ Raspberry Pi Pico 2 W/CircuitPython 10.0.3 with SD Card module. List files in SD. """ import os, sys import board...

1.28" 240x240 Round Display with GC9A01 SPI, on Raspberry Pi Pico 2 W/CircuitPython 10.0.3.

Image
Exercises run on Raspberry Pi Pico 2 W /CircuitPython 10.0.3, to display on 1.28 inch IPS Module: GC9A01+CST816S 240*240(Round) 4W-SPI . Connection: Raspberry Pi Pico 2 W Run | GP22| ------- LCD_BLK ------------+ GND | | GP21| ------- LCD_DC ---------+ | GP20| ------- LCD_RES-------+ | | GP19| MOSI - SPI_SDA ----+ | | | GP18| SCK - SPI_SCL --+ | | | | GND | | | | | | GP17| SS - LCD_CS ---|-|-|-|-+ | GP16| MISO - no use | | | | | | --------+ | | | | | | | | | | | | | | | | | | GC9A01 | | | | | | | | | | | +---- BLK | | | | +------ CS | | | +-------- DC ...

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

RGB NeoPixel on CircuitPython: adafruit_led_animation and rainbowio.colorwheel()

Image
YD-ESP32-S3 N16R8 (by VCC-GND Studio) running CircuitPython 10.1.0-beta.1, to control onboard/external 8x RGB LED, using adafruit_led_animation . cpyS3_led_animation_blink.py """ YD-ESP32-S3 N16R8 (by VCC-GND Studio) running CircuitPython 10.1.0-beta.1 , to control onboard/external 8x RGB LED using adafruit_led_animation. https://coxxect.blogspot.com/2025/12/circuitpython-adafruitledanimation.html """ import board import neopixel from adafruit_led_animation.animation.blink import Blink from adafruit_led_animation.color import RED, GREEN, BLUE # Update to match the pin connected to your NeoPixels pixel_pin = board.NEOPIXEL ext_pixel_pin = board.GPIO4 # Update to match the number of NeoPixels you have connected pixel_num = 1 ext_pixel_num = 8 pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=0.1, auto_write=False) ext_pixels = neopixel.NeoPixel(ext_pixel_pin, ext_pixel_num, brightness=0.1, auto_write=True) blink = Blink(pixels, ...

CircuitPython key detection

Image
Base on the previous exercise of " ESP32-H2-DevKitM-1-N4/CircuitPython display on 1.9" IPS LCD Module, 170x320 ST7789 SPI ", implement key detection using digitalio + debounce and keypad. cpyH2_ST7789_BUTTON.py , key detection using digitalio + debounce. """ ESP32-H2-DevKitM-1-N4/CircuitPython display on 1.9" IPS LCD Module, 170x320 ST7789 SPI. ~ BUTTON detection: digitalio + debounce. Connection: LCD ESP32-H2-DevKitM-1-N4 ----------------------------- GND G VCC 3V3 SCL GPIO5 SDA GPIO4 RES GPIO3 DC GPIO2 CS GPIO1 BLK GPIO0 Libraries need: adafruit_st7789.mpy adafruit_display_text folder adafruit_display_shapes folder """ import os, sys import time import board import displayio import busio import fourwire import adafruit_st7789 from adafruit_display_text import label import terminalio import digitalio spi_sclk = board.IO5 spi_mosi = board.IO4 lcd_rst = board.IO3 lcd_dc = board.IO2 lcd_cs = board.I...

ESP32-H2-DevKitM-1-N4/CircuitPython display on 1.9" IPS LCD Module, 170x320 ST7789 SPI.

Image
ESP32-H2-DevKitM-1-N4 /CircuitPython display on 1.9" IPS LCD Module, 170x320 ST7789 SPI . Exercise Code: cpyH2_ST7789.py , color test. """ ESP32-H2-DevKitM-1-N4/CircuitPython display on 1.9" IPS LCD Module, 170x320 ST7789 SPI. ~ Color test. https://coxxect.blogspot.com/2025/11/esp32-h2-devkitm-1-n4circuitpython_21.html Connection: LCD ESP32-H2-DevKitM-1-N4 ----------------------------- GND G VCC 3V3 SCL GPIO5 SDA GPIO4 RES GPIO3 DC GPIO2 CS GPIO1 BLK GPIO0 Libraries need: adafruit_st7789.mpy adafruit_display_text folder """ import os, sys import time import board import displayio import busio import fourwire import adafruit_st7789 from adafruit_display_text import label import terminalio spi_sclk = board.IO5 spi_mosi = board.IO4 lcd_rst = board.IO3 lcd_dc = board.IO2 lcd_cs = board.IO1 lcd_bl = board.IO0 # 1.9" IPS LCD Module, 170x320 ST7789 SPI. DISPLAY_width = 320 DISPLAY_height = 170 DISPLAY_ROT...