26. Case 26: The Corsair#

26.1. Purpose#


Make a corsair.

../../_images/Wonder-Building-Kit-case-26-01.png

26.3. Materials Required#


../../_images/Wonder-Building-Kit-step-case-26-01.png

26.4. Bricks build-up#


../../_images/Wonder-Building-Kit-step-case-26-02.png

../../_images/Wonder-Building-Kit-step-case-26-03.png

../../_images/Wonder-Building-Kit-step-case-26-04.png

../../_images/Wonder-Building-Kit-step-case-26-05.png

../../_images/Wonder-Building-Kit-step-case-26-06.png

../../_images/Wonder-Building-Kit-step-case-26-07.png

../../_images/Wonder-Building-Kit-step-case-26-08.png

../../_images/Wonder-Building-Kit-step-case-26-09.png

../../_images/Wonder-Building-Kit-step-case-26-10.png

../../_images/Wonder-Building-Kit-step-case-26-11.png

../../_images/Wonder-Building-Kit-step-case-26-12.png

../../_images/Wonder-Building-Kit-step-case-26-13.png

../../_images/Wonder-Building-Kit-step-case-26-14.png

../../_images/Wonder-Building-Kit-step-case-26-15.png

../../_images/Wonder-Building-Kit-step-case-26-16.png

../../_images/Wonder-Building-Kit-step-case-26-17.png

../../_images/Wonder-Building-Kit-step-case-26-18.png

../../_images/Wonder-Building-Kit-step-case-26-19.png

../../_images/Wonder-Building-Kit-step-case-26-20.png

../../_images/Wonder-Building-Kit-step-case-26-21.png

../../_images/Wonder-Building-Kit-step-case-26-22.png

../../_images/Wonder-Building-Kit-step-case-26-23.png

../../_images/Wonder-Building-Kit-step-case-26-24.png

../../_images/Wonder-Building-Kit-step-case-26-25.png

../../_images/Wonder-Building-Kit-step-case-26-26.png

../../_images/Wonder-Building-Kit-step-case-26-27.png

../../_images/Wonder-Building-Kit-step-case-26-28.png

../../_images/Wonder-Building-Kit-step-case-26-29.png

26.5. Hardware Connection#

Connect a servo to S1 port on Wukong breakout board.

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

26.6. Software Platform#


MakeCode

26.7. Coding#


Add extensions#

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

../../_images/Wonder-Building-Kit-case-21-02.png

Search with Wukong in the dialogue box to download it.

../../_images/Wonder-Building-Kit-case-21-03.png

Program#

../../_images/Wonder-Building-Kit-case-26-04.png

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

Result#

When the micro:bit is powering on, it displays a heart icon. When button A is pressed, the corsair begins to swing; when button B is pressed for the second time, the swing amplitude increases, the third time press the A button amplitude and the swing goes to the maximum, the fourth time press the A button, swing amplitude has change; when the button B is pressed, the swing amplitude begins to decrease, when repeatedly pressed B button in three times, it stopped swinging.