14. Case 14: The Reading Range Guitar#

14.1. Purpose#


To make a guitar that is able to read ranges.

../../_images/case-14-01.png

14.3. Materials Required#


../../_images/case-14-02.png

Video link: https://youtu.be/B_P8gOaA0Gc

14.4. 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

14.5. Installation Mthods of Hardwares#

Install the sonar:bit with the bricks.

microbitKit/Wonder_Building_Kit/images/Wonder-Building-Kit-step-sonar-bit-4.png.png

14.6. Hardware Connection#

Connect a sonar:bit to P1 port on Wukong breakout board.

../../_images/Wonder-Building-Kit-case-14-06.png

14.7. Software Platform#


MakeCode

14.8. 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

Result#

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