液体温度传感器 - 图1

python 编程:

创建实例

  • temperature(port_num)
    创建temperature实例,port_num 可取值为 thunbot.PORT_1, thunbot.PORT_2,thunbot.PORT_3, thunbot.PORT_4,thunbot.PORT_A,thunbot.PORT_B

    方法

  • get_temperature()
    获取温度值。

编程示范

  1. import thunbot
  2. import time
  3. t1 = thunbot.temperature(thunbot.PORT_3)
  4. while True:
  5. print(t1.get_temperature())
  6. time.sleep(1)