18. Case 16: The Road Sweeper#

18.1. Purpose#


To make a road sweeper.

../../_images/case-16-01.png

18.3. Materials Required#


../../_images/case-16-02.png

Video link: https://youtu.be/kdY41mPGvRI

18.4. Bricks build-up#


../../_images/step-case-16-01.png

../../_images/step-case-16-02.png

../../_images/step-case-16-03.png

../../_images/step-case-16-04.png

../../_images/step-case-16-05.png

../../_images/step-case-16-06.png

../../_images/step-case-16-07.png

../../_images/step-case-16-08.png

../../_images/step-case-16-09.png

../../_images/step-case-16-10.png

../../_images/step-case-16-11.png

../../_images/step-case-16-12.png

../../_images/step-case-16-13.png

../../_images/step-case-16-14.png

../../_images/step-case-16-15.png

../../_images/step-case-16-16.png

../../_images/step-case-16-17.png

../../_images/step-case-16-18.png

../../_images/step-case-16-19.png

../../_images/step-case-16-20.png

../../_images/step-case-16-21.png

../../_images/step-case-16-22.png

../../_images/step-case-16-23.png

../../_images/step-case-16-24.png

18.5. Hardware Connection#

Connect a motor to M1 port on Wukong breakout board.

../../_images/Wonder-Building-Kit-case-16-06.png

18.6. Software Platform#


MakeCode

18.7. Coding#


Add extensions#

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

../../_images/case-01-03.png

Search with Wukong in the dialogue box to download it.

../../_images/case-01-04.png

Program#

../../_images/case-16-05.png

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

Result#

When button A is pressed, the sweeper moves forward and starts sweeping, when button B is pressed, the sweeper stops moving and ends sweeping.