Use Nezha 48 IN 1 Inventor's Kit and trimpotto build the drum machine that can control the speed with a knob.
Parts List
The structure is built as shown in the figure.
Finished picture:
Connect the trimpot to J1 port, and the Motor to M1 port on Nezha Breakout Board .
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.
Link: https://makecode.microbit.org/_L7shxbLtVJYY
You may also download it directly:
The knob trimpot allows you to control the rhythm of the drummer's strikes.