Posts

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 BLU UART on Seeed Studio XIAO nRF52840/ESP32S3 Sense, connect to Raspberry Pi as Serial Console.

Image
Implement CircuitPython BLU UART on Seeed Studio XIAO nRF52840 Sense / XIAO ESP32S3 Sense running CircuitPython 9.2.7. Library needed: ~ adafruit_ble To install adafruit_ble on CircuitPython device using circup: circup install adafruit_ble Read " Install and using CircUp (CircuitPython library updater) to install CircuitPython libraries " for more about CircUp. Code: cpy_ble_uart.py """ Circuitpython 9.2.7 BLE exercise Run on XIAO nRF52840 Sense/ESP32S3 Sense Act as bridge between BLE UART and UART To make it run as standalone (without REPL connection), copy to CircuitPython device, name "code.py". """ import os, sys import time import board, busio import digitalio from adafruit_ble import BLERadio from adafruit_ble.advertising.standard import ProvideServicesAdvertisement from adafruit_ble.services.nordic import UARTService #------------------------ print("========================================...

ESP32S3 (MicroPython) + MAX98357 I2S Audio Amplifier to play tones

Image
This post exercise on ESP32-S3-DevKitC-1 running MicroPython v1.24.1, to play tones using MAX98357 I2S Audio Amplifier. Connection between MAX98357 and ESP32-S3-DevKitC-1: MAX98357 ESP32-S3-DevKitC-1 ================================== VCC 3V3 GND GND MAX98357_LRC GPIO17 MAX98357_BCLK GPIO16 MAX98357_DIN GPIO15 MAX98357_GAIN GND mpy_s3_max98357.py , a simple MicroPython to play single tone on MAX98357 I2S Audio Amplifier. """ ESP32-S3-DevKitC-1 running MicroPython v1.24.1 Play single tone output to MAX98357. """ import math import array import time from machine import I2S, Pin print("Start") MAX98357_LRC = 17 MAX98357_BCLK = 16 MAX98357_DIN =15 i2s = I2S(0, sck=Pin(MAX98357_BCLK), ws=Pin(MAX98357_LRC), sd=Pin(MAX98357_DIN), mode=I2S.TX, bits=16, format=I2S.MONO, rate=44100, ibuf=44100, ) pr...

ESP32S3/MicroPython display bmp on ili9341 LCD

Image
Last post introduced setup and basic of ESP32-S3-DevKitC-1 running MicroPython v1.24.1 using 3.2" 320x240 IPS LCD (ILI9341 SPI) with Cap. Touch (FT6336U) and Micro SD Slot . This post further exercise to load 240x240 RGB888/RGB565 bmp from device/SD, display on ILI9341 LCD. Remark for ESP32-S3-DevKitC-1: For ESP32-S3-DevKitC-1 with Octal SPI flash/PSRAM memory, use the "spiram-oct" variant such as ESP32_GENERIC_S3-SPIRAM_OCT-20241129-v1.24.1.bin (ref:  https://micropython.org/download/ESP32_GENERIC_S3/ ). If use a in-correct firmware such as ESP32_GENERIC_S3-20241129-v1.24.1.bin, "MemoryError: memory allocation failed" will be raised. For boards with Octal SPI flash/PSRAM memory embedded ESP32-S3-WROOM-1/1U modules, and boards with ESP32-S3-WROOM-2 modules, the pins GPIO35, GPIO36 and GPIO37 are used for the internal communication between ESP32-S3 and SPI flash/PSRAM memory, thus not available for external use. (ref:  https://docs.espressif.c...