Big temperature display ・ 大字室温显示
CoreS3 の画面に大きな文字で室温を表示します。
この構成をエディタで開く・編集する →| 部品 | 役割 | ポート | リンク・価格 |
|---|---|---|---|
| M5Stack CoreS3 | Controller with screen | grove_i2c, grove_analog, grove_uart, mbus, usb_c, sdcard | official page — $59.9 |
| Unit ENV III | Temperature / humidity sensor | grove_i2c | official page — $5.95 |
M5Stack CoreS3とENV IIIユニットで作る、大きな文字で室温を表示する装置です。ENV IIIが温度・湿度・気圧を計測し、CoreS3の画面に大きな数字で温度を表示します。
# M5Stack CoreS3 + ENV III (large temperature display)
# Wiring: ENV III -> CoreS3 red Port.A (I2C)
import time
from machine import Pin, I2C
from m5stack import lcd
# I2C setup on CoreS3 Port.A (pins 32 and 33)
i2c = I2C(0, scl=Pin(33), sda=Pin(32), freq=100000)
# SHT30 I2C address
SHT30_ADDR = 0x44
def read_temperature():
# Send measurement command (0x2C, 0x06) for high repeatability
i2c.writeto(SHT30_ADDR, bytes([0x2C, 0x06]))
time.sleep_ms(20)
data = i2c.readfrom(SHT30_ADDR, 6)
# Convert raw data to temperature (Celsius)
temp_raw = (data[0] << 8) | data[1]
temperature = -45.0 + 175.0 * temp_raw / 65535.0
return temperature
lcd.clear()
while True:
temp = read_temperature()
lcd.clear()
# Display temperature in large font
lcd.font(lcd.FONT_DejaVu40)
lcd.text(lcd.CENTER, lcd.CENTER, '{:.1f}C'.format(temp))
time.sleep(5)
この作り方はAIが構成から生成したものです(未検証)。通電前に配線とコードをご確認ください。
この構成はAIが実在するM5Stack部品から設計し、ポート互換をサーバで検証したものです。編集・共有できます。
エディタで開く →UnitKit は M5Stack® 製品向けの非公式ツール。作りたいものを書くと、部品リストと配線図が出ます。