温湿度传感器(I2C) =================== .. figure:: /_static/products/ledong-module/static/图片/温湿度-H.png :width: 55% :align: center 概述 -------------------- 基于SHT20数字温湿度传感器集成IC。用于检测环境温湿度,具有极高的可靠性和长期稳定性。 技术参数 ------------------- 工作电压: VCC 3.3V -5V 模块尺寸:24*48mm 固定安装:2个兼容塑料积木通孔 温度:-10--50℃ 湿度:0--100% 示例程序 ------------------- 引脚定义 ------------------- ===== ======== 引脚 定义 ===== ======== GND 地 VCC 电源 SCL I2C时钟 SDA I2C数据 ===== ======== **用掌控板OLED显示屏显示温湿度传感器测量的温度和湿度值。** .. code-block:: python from mpython import * from bluebit import * import time sht20 = SHT20() while True: oled.fill(0) oled.DispChar(str(str('当前温度:') + str(sht20.temperature())), 0, 0, 1) oled.DispChar(str(str('当前湿度:') + str(sht20.humidity())), 0, 16, 1) oled.show() time.sleep(0.2) .. figure:: /_static/products/ledong-module/static/examples/温湿度.png :width: 100% :align: center