Case 65: Drum Beater
Contents
69. Case 65: Drum Beater#
69.1. Introduction#
Use Nezha 48 IN 1 Inventor’s Kit and trimpotto build the drum machine that can control the speed with a knob.
69.2. Case building#
Materials Required#
Structure Construction#
Parts List
The structure is built as shown in the figure.
Finished picture:
69.3. Connection Diagram#
Connect the trimpot to J1 port, and the Motor to M1 port on Nezha Breakout Board .
69.4. MakeCode Programming#
Step 1#
Click “Advanced” in the MakeCode drawer to see more choices.
For programming the potentiometer, we need to add an extension library. Type “PlanetX” in the dialog box and click Search, then click Download this library.
For programming the Nezha expansion board, we need to add an expansion library. Type “Nezha” in the dialog box and click Search, then click to download this code library.
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#
Write the program as picture suggests#
Reference#
Link: https://makecode.microbit.org/_L7shxbLtVJYY
You may also download it directly:
Result#
The knob trimpot allows you to control the rhythm of the drummer’s strikes.