54. Case 50: A Small Trash Can¶
54.1. Introduction¶
Make a small trash can with Nezha-A Inventor’s Kit.
54.2. Quick to Start¶
Materials Rrquired¶
Connection Diagram¶
Connect the Motor to M1 on Nezha-A Master Box.
54.3. MakeCode Programming¶
Step 1¶
Click in the “Advanced” in the MakeCode drawer to see more choices.
For programming, we need to add a package: click “Extensions” at the bottom of the MakeCode drawer, and search for “Nezha” in the dialog to download.
Note: If you encounter a prompt that some codebases will be removed due to incompatibility, you can follow the prompt to continue or create a new project in the menu.
Step 2¶
Program as the picture indicates¶
Result¶
Press button A to open the lid of the trash can; press button B to close it.