热敏电阻 =================== .. figure:: /_static/products/ledong-module/static/图片/热敏传感器.png :width: 55% :align: center 概述 -------------------- 热敏电阻随温度升高而增大,可用于测量环境温度变化。 技术参数 ------------------- 工作电压: VCC 3.3V -5V 模块尺寸:24*48mm 固定安装:2个兼容塑料积木通孔 测量范围:0-100℃ 引脚定义 ------------------- ===== ======== 引脚 定义 ===== ======== GND 地 VCC 电源 AO 温度值 NC 空 ===== ======== **1、使用前需将热敏电阻探头插入模块上的耳机接口,注意需将耳机头的金属部分完全插入;** **2、将模块接入模拟输入接口,可以直接获取温度值,单位为℃。** **3、掌控板OLED屏实时显示传感器测量的温度值,同时当温度大于28度时,RGB灯亮红色,反之亮绿色。** 示例程序 ------------------- **图形化代码** .. code-block:: python from mpython import * import math from bluebit import * import time ntc_0 = NTC(0) while True: oled.fill(0) oled.DispChar(str(str('温度:') + str(_ntc_0.getTemper())), 0, 0, 1) oled.show() if _ntc_0.getTemper() > 28: rgb.fill((int(255), int(0), int(0))) rgb.write() time.sleep_ms(1) time.sleep(1) else: rgb.fill((int(51), int(204), int(0))) rgb.write() time.sleep_ms(1) .. figure:: /_static/products/ledong-module/static/examples/热敏温度.png :width: 100% :align: center