Posts

Showing posts with the label RP2040 Series

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

Downloading Bitmap via WiFi with CircuitPython, Saving to Local File System, and Displaying on LCD using OnDiskBitmap.

Image
In my previous post , I demonstrated basic exercises running on the Raspberry Pi Pico 2 W with CircuitPython 10.0.3, displaying graphics on a 1.28‑inch IPS module (GC9A01 + CST816S, 240×240 round, 4‑wire SPI) . In this post, I present exercises using CircuitPython 10.0.3 on the Raspberry Pi Pico 2 W to download a bitmap via WiFi, save it to the local file system, and display it on the GC9A01 LCD using OnDiskBitmap. The BMP in my test was resized and converted from JPG to BMP(240*240 RGB888) using FFmpeg . cpy_rpPicoW_gc9a01_OnDiskBitmap_wifi.py """ Raspberry Pi Pico 2 W/CircuitPython 10.0.3 with 1.28" 240x240 Round GC9A01 SPI IPS LCD Download bmp to local file system and display it using OnDiskBitmap ~ Single bmp. In this exercise, Pico 2 W download image from web server, save it on CircuitPython local filesystem, named "image.bmp, then display it on 1.28" 240x240 Round GC9A01 SPI IPS LCD using OnDiskBitmap. https://coxxect.blogspot.com/2026/01/...

Control onboard LED of Raspberry Pi Pico 2/2W using MicroPython/CircuitPython

Image
The onboard LED on Raspberry Pi Pico and Pico 2 is connected to GPIO25. On Pico W and Pico 2 W, it's connected to the wireless chip. Following are exercise to control the onboard LED using MicroPython/CircuitPython, tested on Pico 2 and Pico 2 W. mpy_rp2_led.py """ MicroPython on Raspberry Pi Pico 2/2W to control onboard LED """ import os, sys import time #import board #from digitalio import DigitalInOut, Direction sys_info_text = sys.implementation[0] + " " + os.uname()[3] +\ "\nrun on " + os.uname()[4] print("=======================================") print(sys_info_text) print("=======================================") led = machine.Pin("LED", machine.Pin.OUT) print("led:", led) # Control onboard led using led.on() and led.off() while True: led.on() time.sleep(0.5) led.off() time.sleep(0.5) """ # Toggle onboard led using led.togg...

UART (Serial1) communication between XIAO ESP32C3 and Raspberry Pi Pico (RP2040), in Arduino framework.

Image
This exercise show UART (Serial1) communication between XIAO ESP32C3 and Raspberry Pi Pico (RP2040) , in Arduino framework. Connection:      Pico TX GP0 (pin 1) <-----> XIAO ESP32C3 RX GPIO20 (pin 8)      Pico RX GP1 (pin 2) <-----> XIAO ESP32C3 TX GPIO21 (pin 7)      Pico GND                        <-----> XIAO ESP32C3 GND Code: The main issue for this exercise is how to handle Serial1.begin() for XIAO ESP32C3. Ref: https://wiki.seeedstudio.com/XIAO_ESP32C3_Pin_Multiplexing/#serial---uart There is no Serial2 for XIAO ESP32 C3. Also If you need to use Serial1, you must define the pins; otherwise, it may not receive data. For XIAO ESP32 series, use Serial1 as follows:      Serial1.begin(115200, SERIAL_8N1, RX, TX); rp_SerialPassthrough_115200_8N1.ino /* UART/Serial1 exercise run on Raspberry Pi Pi...

SSD1306 I2C OLED + 4X4 Matrix Keypad Module on RP2040/CircuiyPython 9

Image
Exercises run on WeAct Studio Pico (rp2040) running CircuitPython 9.0.0-beta.0 with 0.96 inch 128x64 SSD1306 I2C OLED with 4X4 Matrix Keypad Module , to display on OLED using using adafruit_displayio_ssd1306, and detect 4X4 key-matrix using Keypad Module. Libraries need: - adafruit_displayio_ssd1306.mpy - adafruit_display_text folder (If you don't know how to download CircuitPython library bundle and upload to CircuitPython device, read related post RP2040/CircuitPython display on SH1107 SPI OLED ) For SSD1306 I2C OLED: displayio.I2CDisplay  moved from displayio to i2cdisplaybus and renamed I2CDisplayBus. You will not find I2CDisplay in current latest CircuitPython 9 displayio . In CircuitPython 9, it is moved to i2cdisplaybus.I2CDisplayBus . Currently, if you use displayio.I2CDisplay in CircuitPython 9 (actually it will be switched to I2CDisplayBus), it will not raise error, but raise warning: FutureWarning: I2CDisplay moved from ...

BLE communication between MicroPython aioble and ArduinoBLE

Image
Previous posts introduced " MicroPython bluetooth remote control LED between Raspberry Pi Pico W and ESP32-C3, using aioble library " and " BLE examples run on Nano 33 BLE (as Peripheral) and Uno R4 WiFi (as Central) using ArduinoBLE in Arduino Framework ". This video further test how BLE communication between that two approach.

Adafruit_ImageReader exercises run on Raspberry Pi Pico to load images from SD Card, display on 320x240 IPS SPI ILI9341

Image
It's Adafruit_ImageReader exercises run on Raspberry Pi Pico to load images from SD Card, and display on 320x240 IPS SPI ILI9341 Module using using Adafruit_ILI9341 library. Basically follow the page Adafruit GFX Graphics Library Loading Images For 320x240 IPS SPI ILI9341 part using Adafruit_ILI9341 library, refer: ~  Raspberry Pi Pico (RP2040) + 3.2inch IPS SPI Module ILI9341 (using Adafruit_ILI9341 library)  It will also install Adafruit GFX Graphics Library as dependence. This exercise run on Raspberry Pi Pico in Earle Philhower's Arduino core (Raspberry Pi Pico/RP2040). refer: ~ Install Earle Philhower Raspberry Pi Pico Arduino core . Currently Adafruit_ImageReader support uncompressed 24-bit color BMPs only, refer: ~ Convert image to 24-bit color BMPs using GIMP  to prepare s1.bmp ~ s12.bmp, save in root directory of SD card. Install Adafruit_ImageReader and dependence in Arduino IDE Library Manager. Connection: ILI93...