Skip to content

Latest commit

 

History

History
121 lines (61 loc) · 3.82 KB

Nezha_Inventor_s_kit_for_microbit_case_46.md

File metadata and controls

121 lines (61 loc) · 3.82 KB

Case 46:Rangefinder Guitar

Introduction

Build a rangefinder guitar with the Nezha Inventor's Kit.

Quick to Start

Materials Required

Nezha Inventor's Kit

Assembly

Components List

Build it as the assembly steps suggest:

Connection Diagram

Connect the Ultrasonic sensor to J1 on Nezha Breakout Board.

MakeCode Programming

Step 1

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

For programming Ultrasonic sensor, we need to add a package. Search with ”PlanetX“, in the dialogue box and click to download it.

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

Reference

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

You may also download it directly:

<iframe style="position:absolute;top:0;left:0;width:100%;height:100%;" src="https://makecode.microbit.org/#pub:_YzwYdqDiifXh" frameborder="0" sandbox="allow-popups allow-forms allow-scripts allow-same-origin"></iframe>

Result

By detecting the distance between the ultrasonic sensor and the baffle, the buzzer is controlled to emit different tones.