Case 65: Drum Beater
The structure is built as shown in the figure.
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.
Write the program as picture suggests
You may also download it directly:
The knob trimpot allows you to control the rhythm of the drummer's strikes.