# Case 14: The Reading Range Guitar ## Purpose --- To make a guitar that is able to read ranges. ![](./images/case-14-01.png) ## Link: --- [micro:bit Wonder Building Kit](https://shop.elecfreaks.com/products/elecfreaks-micro-bit-32-in-1-wonder-building-kit-without-micro-bit-board?_pos=5&_sid=2094afd2f&_ss=r) ## Materials Required --- ![](./images/case-14-02.png) Video link: [https://youtu.be/B_P8gOaA0Gc](https://youtu.be/B_P8gOaA0Gc) ## Bricks build-up --- ![](./images/step-case-14-01.png) ![](./images/step-case-14-02.png) ![](./images/step-case-14-03.png) ![](./images/step-case-14-04.png) ![](./images/step-case-14-05.png) ![](./images/step-case-14-06.png) ![](./images/step-case-14-07.png) ![](./images/step-case-14-08.png) ![](./images/step-case-14-09.png) ![](./images/step-case-14-10.png) ![](./images/step-case-14-11.png) ![](./images/step-case-14-12.png) ![](./images/step-case-14-13.png) ![](./images/step-case-14-14.png) ![](./images/step-case-14-15.png) ![](./images/step-case-14-16.png) ![](./images/step-case-14-17.png) ![](./images/step-case-14-18.png) ![](./images/step-case-14-19.png) ![](./images/step-case-14-20.png) ![](./images/step-case-14-21.png) ![](./images/step-case-14-22.png) ![](./images/step-case-14-23.png) ![](./images/step-case-14-24.png) ![](./images/step-case-14-25.png) ![](./images/step-case-14-26.png) ![](./images/step-case-14-27.png) ![](./images/step-case-14-28.png) ## Installation Mthods of Hardwares Install the sonar:bit with the bricks. ![](./images/Wonder-Building-Kit-step-sonar-bit-4.png.png) ## Hardware Connection Connect a [sonar:bit](https://www.elecfreaks.com/sonar-bit-for-micro-bit-ultrasonic-sensor-distance-measuring-3v-5v.html) to P1 port on [Wukong breakout board](https://www.elecfreaks.com/wukong-board-with-lego-holder-for-micro-bit.html). ![](./images/Wonder-Building-Kit-case-14-06.png) ## Software Platform --- [MakeCode](https://makecode.microbit.org/) ## Coding --- ### Add extensions Click "Advanced" in the MakeCode to see more choices. ![](./images/case-01-03.png) Search with Wukong in the dialogue box to download it. ![](./images/case-01-04.png) Search with https://github.com/elecfreaks/pxt-sonarbit in the dialogue box to add the sonar:bit extension. ![](./images/case-04-04.png) ### Program ![](./images/case-13-05.png) Link:[https://makecode.microbit.org/_1YvYtE8RM8oL](https://makecode.microbit.org/_1YvYtE8RM8oL) ### Result By detecting the value of the distance between the ultrasonic sensor and the baffle only, the buzzer is controlled to emit different tones.