US-100 传感器的 microbit 驱动

micro:bit编程、教学、展示
STEM
回复
头像
shaoziyang
帖子: 3917
注册时间: 2019年 10月 21日 13:48

US-100 传感器的 microbit 驱动

#1

帖子 shaoziyang »

这是另外一种超声波传感器 US-100 的驱动,可以同时读取温度和距离。

使用方法

Code: Select all

from us100 import US100
from microbit import sleep


sonar=US100()
while True:
print('%.1f' % (sonar.distance_mm()/10))
print('%i' % sonar.temperature)
sleep(1000)
https://github.com/fizban99/microbit_us100

回复

  • 随机主题
    回复总数
    阅读次数
    最新文章