51. Case 47:Wipers#

51.1. Introduction#

Build a wiper with the Nezha Inventor’s Kit.

../../_images/47_1.png

51.2. Quick to Start#

Materials Required#

Nezha Inventor’s Kit

Assembly#

Components List

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

Build it as the assembly steps suggest:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Connection Diagram#

Connect the motors to M1 on Nezha Breakout Board.

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

51.3. MakeCode Programming#

Step 1#

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

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

For programming Nezha Breakout Board, we need to add a package. Search with “Nezha” in the dialogue box and click to download it.

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

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#

Code as the picture suggests#

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

Reference#

Link: https://makecode.microbit.org/_TgWEyTgdVL3z

You may also download it directly:

Result#

When the microbit is powered on, it displays a heart pattern. When button A is pressed, the wiper starts to driving. When button A is pressed again, the wiper accelerates the movement. When button B is pressed, the wiper slows down.

../../_images/47_2.gif