Files
magnus919_agent-skills/esp32-development/templates/micropython-i2c-scan.py
T
Magnus HedemarkandGitHub 36638256a8 feat: add portable ESP32 development skill (#53)
* feat: add portable ESP32 development skill

Add source-backed workflows, safe templates, native CLI routing, and a read-only preflight for ESP32 hardware and firmware work.\n\nAI assistance: research, drafting, implementation, and review used OpenAI Codex and delegated DeepSeek agents under human direction.

* docs: harden ESP32 family and security guidance

Add source-backed family traps, brownout, calibration, USB recovery, and security-mode boundaries found during independent review.\n\nAI assistance: independent audits and drafting used delegated DeepSeek agents and OpenAI Codex under human direction.
2026-07-15 21:45:53 -04:00

18 lines
651 B
Python

"""Temporary MicroPython I2C identity probe. Run with mpremote before copying."""
from machine import I2C, Pin
# Replace from the exact board schematic and MicroPython port documentation.
SDA_PIN = None
SCL_PIN = None
I2C_ID = 0
FREQUENCY_HZ = 100_000
if not isinstance(SDA_PIN, int) or not isinstance(SCL_PIN, int):
raise ValueError("Set SDA_PIN and SCL_PIN from authoritative board documentation")
bus = I2C(I2C_ID, sda=Pin(SDA_PIN), scl=Pin(SCL_PIN), freq=FREQUENCY_HZ)
addresses = bus.scan()
print("I2C addresses:", [f"0x{address:02x}" for address in addresses])
print("A scan is an electrical/address clue; verify device identity next.")