Using the Unit Glass2 ・ 使用 Unit Glass2
M5StackのUnit Glass2をコントローラーに接続する最小構成。配線とBOMつき。
この構成をエディタで開く・編集する →| 部品 | 役割 | ポート | リンク・価格 |
|---|---|---|---|
| AtomS3 Lite | Controller | grove_i2c, gpio, usb_c | official page — $7.5 |
| Unit Glass2 | unit | grove_i2c | official page — $21.5 |
AtomS3 LiteとUnit Glass2をGrove I2Cケーブルで接続し、透明OLEDディスプレイに文字や図形を表示する最小構成のビルドです。
# AtomS3 Lite + Unit Glass2 (SSD1309 OLED)
# Wiring: Unit Glass2 -> AtomS3 Lite Grove Port (Port.A, I2C)
import time
from machine import Pin, I2C
import ssd1306
# AtomS3 Lite I2C pins: SDA=GPIO1, SCL=GPIO2 (Port.A)
i2c = I2C(0, scl=Pin(2), sda=Pin(1), freq=400000)
# Scan I2C bus for devices
print('Scanning I2C bus...')
devices = i2c.scan()
if len(devices) == 0:
print('No I2C device found!')
else:
print('I2C devices found:', [hex(d) for d in devices])
# Unit Glass2 uses SSD1309 driver, typically at address 0x3C
oled = ssd1306.SSD1306_I2C(128, 64, i2c, addr=0x3C)
# Clear display and show text
oled.fill(0)
oled.text('Hello, Glass2!', 0, 0)
oled.show()
# Blink the AtomS3 internal LED (GPIO 10)
led = Pin(10, Pin.OUT)
while True:
led.on()
time.sleep(0.5)
led.off()
time.sleep(0.5)
この作り方はAIが構成から生成したものです(未検証)。通電前に配線とコードをご確認ください。
この構成はAIが実在するM5Stack部品から設計し、ポート互換をサーバで検証したものです。編集・共有できます。
エディタで開く →UnitKit は M5Stack® 製品向けの非公式ツール。作りたいものを書くと、部品リストと配線図が出ます。