Posts

Showing posts from January, 2024

my dev.board - Raspberry Pi Zero 2 W

Image
 my dev.board - Raspberry Pi Zero 2 W related: ~  Install CircuitPython on Raspberry Pi Zero 2 W

ESP32-S3-Zero/CircuitPython read single key using keypad.Keys and control onboard RGB LED (NeoPixel)

Image
ESP32-S3-Zero/CircuitPython exercises to read single key using keypad.Keys and control onboard RGB LED (NeoPixel). neopixel is a CircuitPython NeoPixel strip driver. keypad module provides native support to scan sets of keys or buttons, connected independently to individual pins, connected to a shift register, or connected in a row-and-column matrix. (misspelled filename, it's S3) cpy_C3-Zero_RGB.py """ ESP32-S3-Zero/circuitpython 9.0.0-beta.0 exercise to control on-board RGB (NeoPixel) """ import os, sys 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):

ESP32-S3-Zero/CircuitPython Display on 128x64 SSD1306 I2C OLED

Image
Waveshare ESP32-S3-Zero/CircuitPython 9.0.0-beta.0 to display on 128x64 SSD1306 I2C OLED. Connection: SSD1306 I2C ESP32-S3-Zero GND GND VCC 3V3 SCL GP1 SDA GP2 Libraries: Prepare Libraries, visit https://circuitpython.org/libraries . Download Library Bundle matched CircuitPython version on your board. Extract it and copy needed libraries to /lib folder in CircuitPython /lib folder. For the code cpy_C3-Zero_ssd1306_framebuf.py, font5x8.bin is needed also. Copy it from examples folder to current folder in CircuitPython device. Code: (misspelled filename, it's S3) cpy_C3-Zero_ssd1306_framebuf.py """ CircuitPython 9.0.0-beta.0 exercise run on Waveshare ESP32-S3-Zero - display on SSD1306 I2C OLED - using adafruit_ssd1306 lib needed: - adafruit_ssd1306.mpy - adafruit_framebuf.mpy - font5x8.bin (from examples folder, to current folder in CircuitPython device) """ import os import sy

How much current drawn by Raspberry Pi Camera Module 3?

Image
It's a roughly test on Raspberry Pi 5/64-bit Raspberry Pi OS (bookworm) with Camera Module 3 (NoIR Wide and normal) .

CircuitPython I2C Scanner, run on ESP32-S3-Zero

Image
CircuitPython I2C Scanner, run on WaveShare ESP32-S3-Zero / CircuitPython 9.0.0-beta.0 . cpy_S3-Zero_I2C_Scanner.py """ CircuitPython run on ESP32-S3-Zero scan I2C devices' address """ import sys, os import board import busio SCL = board.IO1 SDA = board.IO2 i2c = busio.I2C(SCL, SDA) print("=================================================") info = sys.implementation[0] + ' ' + os.uname()[3] + '\n' + \ 'run on ' + os.uname()[4] print(info) print("I2C Scanner") print("=================================================") # wait untill i2c locked while not i2c.try_lock(): pass print([hex(x) for x in i2c.scan()]) i2c.unlock()

Install CircuitPython firmware on Waveshare ESP32-S3-Zero, run on Raspberry Pi OS (bookworm).

Image
With esptool installed on Raspberry Pi 5 running Raspberry Pi OS (bookworm) , this video show steps to install CircuitPython 9.0.0-beta.0 on Waveshare ESP32-S3-Zero . Visit https://circuitpython.org/downloads , search ESP32-S3-Zero. It's custom build of CircuitPython 9.0.0-beta.0 for Waveshare ESP32-S3-Zero. Download the .BIN file. Erase flash: $ esptool.py --chip esp32s3 --port <PORT> erase_flash Write flash: $ esptool.py --chip esp32s3 --port <PORT> --baud 460800 write_flash -z 0x0 <.BIN> Test Code pinmap.py """CircuitPython Essentials Pin Map Script""" import microcontroller import board import os import sys info = os.uname()[4] + "\n" + \ sys.implementation[0] + " " + os.uname()[3] print("=======================================") print(info) print("=======================================") print() board_pins = [] for pin in dir(microcontroller.pin): if

Install esptool inside Virtual Environment, on Raspberry Pi 5 running 64-bit Raspberry Pi OS (bookworm).

Image
In pre-bookworm Raspberry Pi OS, esptool can be install esptool directly, system-wide, using pip. This is no longer the case in the new Raspberry Pi OS (bookworm). From bookworm onwards, when using pip, packages must be installed into a Python virtual environment. (ref: https://www.raspberrypi.com/documentation/computers/os.html#installing-python-packages-using-apt ) This video show steps in  Esptool.py Documentation  to Install esptool inside Virtual Environment, on Raspberry Pi 5 running 64-bit Raspberry Pi OS (bookworm). - Create a virtual environment and choose its name, e.g. ‘esptoolenv’:   $ python -m venv esptoolenv - Activate the virtual environment:   $ source esptoolenv/bin/activate - Install the esptool.py within the active virtual environment:   $ pip install esptool - When you’re done, deactivate the virtual environment:   $ deactivate next: ~  Install CircuitPython firmware on Waveshare ESP32-S3-Zero

Fix Waveshare ESP32-S3-Zero/Nologo ESP32C3SuperMini Serial.print() not work - enable USB CDC on Boot

Image
Waveshare ESP32-S3-Zero   does not have a USB to UART chip mounted, you need to use the USB of the ESP32-S3 as the download interface and the Log print interface, and you need to enable the USB CDC when using the Arduino IDE . ~ ref:  https://www.waveshare.com/wiki/ESP32-S3-Zero This apply to  Nologo ESP32C3SuperMini also .

my dev.tools - FNIRSI 2C23T 3-in-1 Dual Channel Oscilloscope/Multimeter/Signal Generator

Image
FNIRSI 2C23T 3-in-1 Dual Channel Oscilloscope/Multimeter/Signal Generator Steps to upgrade of FNIRSI 2C23T 3-in-1 : Remark@2024-03-23: Please check the comment by dmitriivanov5330 in the video. How to distinguish the hardware? please press menu , and if you can see the words in Setting: "Hardware version No.:XXXXX " then the device is made with latest hardware, it has the latest firmware, and now it doesn't need to upgrade.  If you can not see the words in Setting: "Hardware version No.:XXXXX ", then it is made with old hardware, and it can be upgraded with firmware 2.0.2, and if you confirm this, the firmware for the device with old hardware is attached.  By the way, the firmware 2.0.2 only fixes device with old hardware. The device with new hardware can not use this firmware to upgrade. - Download firmware from FNIRSI Official Web Site - Connect USB to PC - While 2C23T is OFF, press and hold MENU button, then press POWER button to power

Python/PyQt5/Picamera2 to control Raspberry Pi Cameras with GUI, added White Balance setting.

Image
Further works on my previous post Python/PyQt5/Picamera2 to control Raspberry Pi Cameras with GUI, with camera_controls , added White Balance setting. Actually, I'm not sure the setting and operation of Awb and ColourGains. refer:  ~ The Picamera2 Library document, Appendix C: Camera controls. Code: picam2_qt5_2024-01-20.py """ Python 3/PyQt5 + picamera2 to control Raspberry Pi Camera Modules Tested on Raspberry Pi 5/64-bit Raspberry Pi OS (bookworm) # in my setup: # Picamera2(0) - HQ Camera # Picamera2(1) - Camera Module 3 picam2_qt5_2023-12-28.py first exercise picam2_qt5_2024-01-03.py Added Auto-Focus feature detection, and switch AF Mode between Continuous & Manual picam2_qt5_2024-01-07.py Display Preview in seperated window, both Main/Preview windows have Capture button. picam2_qt5_2024-01-13.py Add camera_controls to adjust brightness at runtime. Handle sys.argv, such that user can select cam at c

my dev.board - Waveshare ESP32-S3-Zero

Image
ESP32-S3-Zero by Waveshare Product page: ~  ESP32-S3-Zero - Waveshare Wiki Pinout: Close-up view: Arduino Exercise: ~  BlinkRGB Exercise run on WaveShare ESP32-S3-Zero, in Arduino Framework ~  ESP32-S3-Zero display on 0.85 inch 128x128 LCD with GC9107 SPI driver, using Arduino_GFX . ~  Fix ESP32-S3-Zero Serial.print() not work - enable USB CDC on Boot CircuitPython: ~  Install esptool inside Virtual Environment, on Raspberry Pi 5 running 64-bit Raspberry Pi OS (bookworm) . ~  Install CircuitPython firmware on Waveshare ESP32-S3-Zero ~  CircuitPython I2C Scanner, run on ESP32-S3-Zero ~  ESP32-S3-Zero/CircuitPython Display on 128x64 SSD1306 I2C OLED ~  ESP32-S3-Zero/CircuitPython read single key using keypad.Keys and control onboard RGB LED (NeoPixel) ~  Use VL53L0X (Time of Flight distance sensor) on ESP32-S3/CircuitPython ~  3-wire 9-bit SPI ST7789 TFT with FT6236 capacitive touch on ESP32-S3-Zero/CircuitPython ~  CircuitPython exerc

ESP32-S3-Zero display on 0.85 inch 128x128 LCD with GC9107 SPI driver, using Arduino_GFX.

Image
This post show steps to using Waveshare ESP32-S3-Zero to display on Waveshare 0.85 inch 128x128 LCD with GC9107 SPI driver , using GFX Library for Arduino (Arduino_GFX)​. Make sure GFX Library for Arduino (Arduino_GFX) is installed in Library Manager. Connection: GC9107 ESP32-S3-Zero --------------------- VCC 3V3 GND GND DIN GP11 CLK GP12 CS GP10 DC GP9 RST GP8 BL GP7 Code for Arduino_GFX setting: //========== Arduino_GFX setting =============================================== #define TFT_DIN 11 #define TFT_CLK 12 #define TFT_CS 10 #define TFT_DC 9 #define TFT_RST 8 #define TFT_BL 7 #define GFX_BL TFT_BL // https://github.com/moononournation/Arduino_GFX/wiki/Data-Bus-Class#spi-1 Arduino_DataBus *bus = new Arduino_ESP32SPI(TFT_DC, TFT_CS, TFT_CLK, TFT_DIN, GFX_NOT_DEFINED /* MISO */, HSPI /* spi_num */); //https://github.com/moononournation/Arduino_GFX/wiki/Display-Class#gc9107-ips-lcd-128x128 Arduino_GFX *gfx = new Arduino_GC910

Dev. Board: CH32V307V_EVT-R1

Image
CH32V307V_EVT-R1 : CH32V307V (32-bit RISC-V MCU) evaluation board, by WCH Nanjing Qinheng Microelectronics Co., Ltd . Related link: ~  32-bit Interconnectivity RISC-V MCU – CH32V307 (English) ~ Currently,  CH32V307EVT evaluation board manual and reference routines: CH32V307EVT.ZIP is available in Chinese version only:  互联型RISC-V单片机 CH32V307 . Related: ~  Hello CH32V307, flash & run GPIO_Toggle example on CH32V307V_EVT-R1, to blink LED and monitor USART .

Python/PyQt5/Picamera2 to control Raspberry Pi Cameras with GUI, with camera_controls.

Image
Follow my previous exercise  Python/PyQt5 GUI to control Raspberry Pi Camera using picamera2 lib , added function to change camera_controls for brightness at runtime. This video also show two instances run to control two cameras at the same time. Because my Camera Module 3 (with Auto-Focus) is assigned to Picamera2(1), so I make 1 as default. If you have one camera only, or you want 0 as default, set: DEFAULT_CAM_NUM = 0 picam2_qt5_2024-01-13.py """ Python 3/PyQt5 + picamera2 to control Raspberry Pi Camera Modules Tested on Raspberry Pi 5/64-bit Raspberry Pi OS (bookworm) # in my setup: # Picamera2(0) - HQ Camera # Picamera2(1) - Camera Module 3 picam2_qt5_2023-12-28.py first exercise picam2_qt5_2024-01-03.py Added Auto-Focus feature detection, and switch AF Mode between Continuous & Manual picam2_qt5_2024-01-07.py Display Preview in seperated window, both Main/Preview windows have Capture button. picam2_qt5_2024-01-13.py Add camera_controls to adjust brig