跳到主要内容

Case 14: 别碰我

简介

制作一辆天蓬车,当它被拿起时则会发出警报。

购买链接

TPBot micro:bit v2

软件

MicroSoft makecode

Programming

Click "Advanced" in the MakeCode drawer to see more choices.

We need to add a package for programming. Click "Extensions" in the bottom of the drawer and search with "tpbot" to download it.

Sample

Link:https://makecode.microbit.org/_VcfdkRUW6TUs

You may also download it directly below:

Conclusion

通过加速度计判断天蓬车的状态,当天蓬车被拿起来时,灯光闪烁并蜂鸣器发出声音;放下后停止,显示爱心。