31. Case 29: The Stone Thrower#

31.1. Purpose#


Make a stone thrower.

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

31.3. Materials Required#


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

31.4. Bricks build-up#


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

31.5. Hardware Connection#

Connect two motors to M1 and M2 ports on Wukong breakout board.

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

31.6. Software Platform#


MakeCode

31.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-29-04.png

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

Result#

When the micro:bit is powering on, it displays a heart icon. When button A is pressed, the stone thrower performs a stone throwing action; when button B is continuously pressed, the stone thrower moves forward; release button B and the stone thrower stops.