题目

某传感器实验要实现如下功能:micro:bit通过传感器dht11获取温湿度,通过串口与计算机传送数据,当用户在计算机上输入字符“T”,在micro:bit的LED阵列上显示温度,输入字符“H”,则显示湿度。micro:bit中烧录如下代码:from microbit importimport dht11while True: temp, hum=dht11.read (pin1) if uart.any: incni'ng-str (uart.readal1 O, UTE-8'》incoming=incoming.strip('n') if incoming='T':display .show (temp)①:display.show (hum) else: display.scroll ('err')在计算机端的Python程序如下:import serial, timeser=s生物体的全部性状都能遗传.BB(判断对错)
信息技术 试题推荐