51. Case 50: A Small Trash Can#

51.1. Introduction#

Make a small trash can with Nezha-A Inventor’s Kit.

../../_images/neza-inventor-s-kit-case-50-01.png

51.2. Quick to Start#

Materials Rrquired#

Nezha-A Inventor’s Kit

Assembly#

Components List

../../_images/neza-inventor-s-kit-case-50-02.png

Build as the steps suggest:

../../_images/neza-inventor-s-kit-step-50-01.png

../../_images/neza-inventor-s-kit-step-50-02.png

../../_images/neza-inventor-s-kit-step-50-03.png

../../_images/neza-inventor-s-kit-step-50-04.png

../../_images/neza-inventor-s-kit-step-50-05.png

../../_images/neza-inventor-s-kit-step-50-06.png

../../_images/neza-inventor-s-kit-step-50-07.png

../../_images/neza-inventor-s-kit-step-50-08.png

../../_images/neza-inventor-s-kit-step-50-09.png

../../_images/neza-inventor-s-kit-step-50-10.png

../../_images/neza-inventor-s-kit-step-50-11.png

../../_images/neza-inventor-s-kit-step-50-12.png

../../_images/neza-inventor-s-kit-step-50-13.png

../../_images/neza-inventor-s-kit-step-50-14.png

../../_images/neza-inventor-s-kit-step-50-15.png

../../_images/neza-inventor-s-kit-step-50-16.png

../../_images/neza-inventor-s-kit-step-50-17.png

../../_images/neza-inventor-s-kit-step-50-18.png

../../_images/neza-inventor-s-kit-step-50-19.png

../../_images/neza-inventor-s-kit-step-50-20.png

Connection Diagram#

Connect the Motor to M1 on Nezha-A Master Box.

../../_images/neza-inventor-s-kit-case-48-03.png

51.3. MakeCode Programming#

Step 1#

Click in the “Advanced” in the MakeCode drawer to see more choices.

../../_images/neza-inventor-s-kit-case-37-04.png

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.

../../_images/neza-inventor-s-kit-case-37-06.png

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#

../../_images/neza-inventor-s-kit-case-50-07.png

Result#

Press button A to open the lid of the trash can; press button B to close it.