Case 14: 测距吉他
目的
使用悟空创意搭建套装制作一把测距吉他。

购买链接
所需材料

搭建视频链接: https://player.bilibili.com/player.html?bvid=BV1V64y117zM&p=14&page=14
搭建步骤




























硬件连接
将超声波传感器连接到悟空扩展板的P1接口。

软件编程平台
编写程序
添加专属扩展库
在MakeCode的代码抽屉中点击高级,查看更多代码选项,点击扩展。

在搜索框中搜索wukong,点击图片中wukong,添加扩展包。

Search with https://github.com/elecfreaks/pxt-sonarbit in the dialogue box to add the sonar:bit extension.

程序

程序链接:https://makecode.microbit.org/_eRoHiEXrt6yU
结果
开启之后,推动挡板,micro:bit根据挡板位置发出不同音符的声音。
