from machine import Pin, I2C
import time  # タイムスリープを使うために追加
from dht20 import DHT20  

i2c = I2C(0, scl=Pin(9), sda=Pin(8))
dht20 = DHT20(i2c) 

while True:
    t = dht20.temperature
    h = dht20.humidity

    # カンマで区切る形に修正
    print("tem:", t)
    print("Hed:", h)
    print("----------------")

    time.sleep(1) # 1秒待って繰り返す