# Case 46:Rangefinder Guitar ## Introduction Build a rangefinder guitar with the [Nezha Inventor's Kit](https://shop.elecfreaks.com/products/elecfreaks-micro-bit-nezha-48-in-1-inventors-kit-without-micro-bit-board?_pos=2&_sid=ed1b6fbd2&_ss=r). ![](./images/neza-inventor-s-kit-case-46-01.png) ## Quick to Start ### Materials Required [Nezha Inventor's Kit](https://shop.elecfreaks.com/products/elecfreaks-micro-bit-nezha-48-in-1-inventors-kit-without-micro-bit-board?_pos=2&_sid=ed1b6fbd2&_ss=r) ### Assembly Components List ![](./images/neza-inventor-s-kit-case-46-02.png) Build it as the assembly steps suggest: ![](./images/neza-inventor-s-kit-step-46-01.png) ![](./images/neza-inventor-s-kit-step-46-02.png) ![](./images/neza-inventor-s-kit-step-46-03.png) ![](./images/neza-inventor-s-kit-step-46-04.png) ![](./images/neza-inventor-s-kit-step-46-05.png) ![](./images/neza-inventor-s-kit-step-46-06.png) ![](./images/neza-inventor-s-kit-step-46-07.png) ![](./images/neza-inventor-s-kit-step-46-08.png) ![](./images/neza-inventor-s-kit-step-46-09.png) ![](./images/neza-inventor-s-kit-step-46-10.png) ![](./images/neza-inventor-s-kit-step-46-11.png) ![](./images/neza-inventor-s-kit-step-46-12.png) ![](./images/neza-inventor-s-kit-step-46-13.png) ![](./images/neza-inventor-s-kit-step-46-14.png) ![](./images/neza-inventor-s-kit-step-46-15.png) ![](./images/neza-inventor-s-kit-step-46-16.png) ![](./images/neza-inventor-s-kit-step-46-17.png) ![](./images/neza-inventor-s-kit-step-46-18.png) ![](./images/neza-inventor-s-kit-step-46-19.png) ![](./images/neza-inventor-s-kit-step-46-20.png) ![](./images/neza-inventor-s-kit-step-46-21.png) ![](./images/neza-inventor-s-kit-step-46-22.png) ![](./images/neza-inventor-s-kit-step-46-23.png) ![](./images/neza-inventor-s-kit-step-46-24.png) ![](./images/neza-inventor-s-kit-step-46-25.png) ![](./images/neza-inventor-s-kit-step-46-26.png) ![](./images/neza-inventor-s-kit-step-46-27.png) ![](./images/neza-inventor-s-kit-step-46-28.png) ![](./images/neza-inventor-s-kit-step-46-29.png) ![](./images/neza-inventor-s-kit-step-46-30.png) ### Connection Diagram Connect the [Ultrasonic sensor](https://shop.elecfreaks.com/products/elecfreaks-planetx-ultrasonic-sensor?_pos=1&_sid=9f90a6738&_ss=r) to J1 on [Nezha Breakout Board](https://shop.elecfreaks.com/products/elecfreaks-nezha-breakout-board?_pos=1&_sid=00432325a&_ss=rl). ![](./images/neza-inventor-s-kit-case-46-03.png) ## MakeCode Programming ### Step 1 Click "Advanced" in the MakeCode drawer to see more choices. ![](./images/neza-inventor-s-kit-case-37-04.png) For programming [Ultrasonic sensor](https://shop.elecfreaks.com/products/elecfreaks-planetx-ultrasonic-sensor?_pos=1&_sid=9f90a6738&_ss=r), we need to add a package. Search with ”PlanetX“, in the dialogue box and click to download it. ![](./images/neza-inventor-s-kit-case-37-05.png) *Notice*: If you met a tip indicating that some codebases would be deleted due to incompatibility, you may continue as the tips say or create a new project in the menu. ### Step 2 ### Code as the picture suggests ![](./images/neza-inventor-s-kit-case-46-07.png) ### Reference Link: [https://makecode.microbit.org/_YzwYdqDiifXh](https://makecode.microbit.org/_YzwYdqDiifXh) You may also download it directly:
### Result By detecting the distance between the ultrasonic sensor and the baffle, the buzzer is controlled to emit different tones. ![](./images/46_2.gif)