12. Case 12: The Forklift#

12.1. Purpose#


To make a forklift.

../../_images/case-12-01.png

12.3. Materials Required#


../../_images/case-12-02.png

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

12.4. Bricks build-up#


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

12.5. Hardware Connection#

Connect two motors to M1 and M2, the servo to S0 ports on Wukong breakout board.

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

12.6. Software Platform#


MakeCode

12.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

Search with https://github.com/elecfreaks/pxt-sonarbit in the dialogue box to add the sonar:bit extension.

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

Program#

For Joystick:bit:

../../_images/case-12-05.png

Link:https://makecode.microbit.org/_f5DVqMKrtgYA For the forklift:

../../_images/case-12-06.png

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

Result#

Use the handle to control the forklift, the up and down, left and right directions of the handle rocker are to control the forward and backward, the left and right movement of the forklift, D button to control the raisin of the forklift, C button to control the lowering of it.