人体红外传感器

python 编程:

创建实例

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

方法

  • get_status()
    获取传感器感应结果,如果人或物体移动,返回"1",否则返回"0"

编程示范


import thunbot
import time

h3 = thunbot.human(thunbot.PORT_3)

while True:
  print(h3.get_status())
  time.sleep(1)

results matching ""

    No results matching ""