简单测试¶
确保您的设备能够通过这个简单的测试。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
import board
import adafruit_adt7410
i2c_bus = board.I2C()
adt = adafruit_adt7410.ADT7410(i2c_bus, address=0x48)
adt.high_resolution = True
while True:
print(adt.temperature)
time.sleep(0.5)
|