Posts

CircuitPython Exercise: Touch buttons on ILI9341 SPI LCD with FT6336 Cap. Touch

Image
My former post show ESP32-S3/CircuitPython exercises for Capacitive Touch Screen, to display on 3.2" 320x240 IPS LCD (ILI9341 SPI) and read capacitive touch (FT6336) . This post I list further exercises to implement a useful Touch Button on the Capacitive Touch Screen, using  Adafruit Display_Button Library . For the connection, read the former post . Remark for using irq_pin in Adafruit_FocalTouch (CircuitPython driver for common low-cost FocalTech capacitive touch chips. Currently supports FT6206 & FT6236): In case you create Adafruit_FocalTouch object using a Bus I2C port and using an interrupt pin (IRQ) like below: ft = adafruit_focaltouch.Adafruit_FocalTouch(i2c, debug=False, irq_pin=irq) The interrupt pin (irq_pin) is used to prevent read errors from the FocalTouch chip. In my test with irq_pin=touch_irq, reading ft.touched will not return if not touched; such that the program will be blocked untill touched. As...

ESP-NOW on CircuitPython 9.0.3, tested on ESP32-S3/ESP32-C3.

Image
ESP-NOW is a kind of connectionless Wi-Fi communication protocol that is defined by Espressif. In ESP-NOW, application data is encapsulated in a vendor-specific action frame and then transmitted from one Wi-Fi device to another without connection. CircuitPython espnow module provides an interface to the ESP-NOW protocol. It's exercises of CircuitPython espnow to communicate between sender ( Waveshare ESP32-S3-Zero / Seeed Studio XIAO ESP32C3 ) and receiver ( Espressif ESP32-S3-DevKitC-1 ). In the receiver side, the receiver message are display on ILI9341 SPI LCD. For the setting of using ILI9341 SPI LCD, read  3.2" 320x240 IPS LCD (ILI9341 SPI) with Cap. Touch (FT6336) and Micro SD Slot on ESP32-S3/CircuitPython 9.0.3 . Exercise Code: cpyS3_ili9341_espnow_receiver.py , run on Espressif ESP32-S3-DevKitC-1 and display on ILI9341 SPI LCD. """ CircuitPython exercise of espnow Act as ESP-NOW receiver, display received msg/mac-ad...

CircuitPython to download bmp images from web, and display on ILI9341 SPI TFT.

Image
Last post show ESP32-S3 running CircuitPython 9.0.3 to display on ILI9341 SPI LCD, detect FT6336 Cap. Touch, and load bmp from SD card using adafruit_imageload . The post show exercise to download bmp images from internet and display on ILI9341 SPI LCD. Basically, the network part follow the CircuitPython  adafruit_imageload example imageload_from_web.py . In the original example, bmp file is downloaded from https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_ImageLoad/main/examples/images/4bit.bmp . In this exercise, my own Python http server was setup on Raspberry Pi 5/64-bit Raspberry Pi OS (bookworm), to store my bmp images. Enter the command in Terminal: python3 -m http.server Or save it in a executable shell script as shown in the video. Exercise code: cpyS3_ili9341_imageload_from_web.py """ CircuitPython exercise run on ESP32-S3, to load image from web and display on ILI9341 SPI LCD. ref: https://github.com/adafruit/...

3.2" 320x240 IPS LCD (ILI9341 SPI) with Cap. Touch (FT6336) and Micro SD Slot on ESP32-S3/CircuitPython 9.0.3

Image
Exercise to work with 3.2" 320x240 IPS LCD (ILI9341 SPI) with Cap. Touch (FT6336) and Micro SD Slot , on Espressif ESP32-S3-DevKitC-1 running CircuitPython 9.0.3. Connection: ESP32-S3-DevKitC-1 +---USB-----USB---+ |GND      GND | |GND      5V0 | |GPIO19      GPIO14| |GPIO20      GPIO13| |GPIO21      GPIO12| |GPIO47      GPIO11| |GPIO48      GPIO10| |GPIO45      GPIO9 | |GPIO0      GPIO46| |GPIO35      GPIO3 | |GPIO36      GPIO8 | |GPIO37      GPIO18| |GPIO38      GPIO17| LCD_CS |GPIO39      GPIO16| LCD_RST |GPIO40      GPIO15| LCD_RS |GPIO41      GPIO7 | SDI (MOSI) CTP_SCL |GPIO42      GPIO6 | SCK CTP_RST |GPIO2     ...

Python 3/PyQt5 + picamera2 on Raspberry Pi, list available cameras.

Image
In previous exercises of Python/PyQt5 GUI to control Raspberry Pi Camera using picamera2 lib , with camera_controls and White Balance , camera is assigned manually in Python code or command line argument. In this exercise (picam2_qt5_global.py), number of cameras attached and cameras info are retrieved by calling Picamera2.global_camera_info(), then run picam2_qt5_.py base on user selection. Code: picam2_qt5_global.py """ Python 3/PyQt5 + picamera2 List available cameras. Run picam2_qt5_.py base on user selection. """ from PyQt5.QtWidgets import (QComboBox, QMainWindow, QApplication, QWidget, QVBoxLayout, QLabel, QLineEdit, QPushButton) from PyQt5.QtCore import QProcess import sys from picamera2 import Picamera2 cameras_info = Picamera2.global_camera_info() num_of_cam = len(cameras_info) if num_of_cam == 0: print("No camera attached! Exit") exit(1) print("number of cameras: ...