Using the Unit Puzzle ・ 使用 Unit Puzzle
M5StackのUnit Puzzleをコントローラーに接続する最小構成。配線とBOMつき。
この構成をエディタで開く・編集する →| 部品 | 役割 | ポート | リンク・価格 |
|---|---|---|---|
| AtomS3 Lite | Controller | grove_i2c, gpio, usb_c | official page — $7.5 |
| Unit Puzzle | unit | grove_analog, grove | official page — $7.5 |
AtomS3 LiteとUnit Puzzleで作る、カラフルな8x8 LEDマトリックス表示装置です。Unit Puzzleは64個のアドレス指定可能なRGB LEDを搭載しており、AtomS3 Liteから制御して様々な色やパターンを表示できます。Groveケーブル1本で簡単に接続でき、プログラミングでアニメーションも楽しめます。
# M5Stack AtomS3 Lite + Unit Puzzle (8x8 RGB LED matrix)
# Wiring: Unit Puzzle -> AtomS3 Lite black Port.B (Grove analog, but used as digital output for NeoPixel)
# Note: AtomS3 Lite Port.B uses GPIO 1 for data (check your device, may vary)
import time
from machine import Pin
from neopixel import NeoPixel
# Define the NeoPixel pin (Port.B on AtomS3 Lite is typically GPIO 1)
# If your unit uses a different pin, change this.
PIN = 1
NUM_LEDS = 64 # 8x8 matrix
np = NeoPixel(Pin(PIN), NUM_LEDS)
def rainbow_cycle(wait):
for j in range(255):
for i in range(NUM_LEDS):
pixel_index = (i * 256 // NUM_LEDS) + j
np[i] = wheel(pixel_index & 255)
np.write()
time.sleep_ms(wait)
def wheel(pos):
if pos < 85:
return (pos * 3, 255 - pos * 3, 0)
elif pos < 170:
pos -= 85
return (255 - pos * 3, 0, pos * 3)
else:
pos -= 170
return (0, pos * 3, 255 - pos * 3)
# Main loop
while True:
rainbow_cycle(10)
この作り方はAIが構成から生成したものです(未検証)。通電前に配線とコードをご確認ください。
この構成はAIが実在するM5Stack部品から設計し、ポート互換をサーバで検証したものです。編集・共有できます。
エディタで開く →UnitKit は M5Stack® 製品向けの非公式ツール。作りたいものを書くと、部品リストと配線図が出ます。