5. Case 03: Turn A Circle

5.1. Purpose


  • Programme to make Wonder Rugged Kit turn a circle.

5.2. Materials


  • micro:bit Wonder Rugged Kit

5.3. Background Knowledge


5.4. Software


MicroSoft makecode

5.5. Program


Step 1

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

https://raw.githubusercontent.com/elecfreaks/learn-cn/master/microbitKit/Mecanum_wheel_car_kit/images/Mecanum%20wheel%20car%20kit_case_01_01.png

For programming, we need to add a package. Click “Extensions” at the bottom of the drawer and then search “Wukong” in the dialogue box to download it.

https://raw.githubusercontent.com/elecfreaks/learn-cn/master/microbitKit/Mecanum_wheel_car_kit/images/Mecanum%20wheel%20car%20kit_case_01_02.png

Note:If you get a warning indicating some packages will be removed because of incompatibility issues, you can follow the prompts or create a new project in the menu.

Step 2

Click Wukong to choose mecanum block.

https://raw.githubusercontent.com/elecfreaks/learn-cn/master/microbitKit/Mecanum_wheel_car_kit/images/Mecanum%20wheel%20car%20kit_case_01_03.png

Step 3

Drag mecanum into on start block and set the connection for servos accordingly.

https://raw.githubusercontent.com/elecfreaks/learn-cn/master/microbitKit/Mecanum_wheel_car_kit/images/Mecanum%20wheel%20car%20kit_case_03_05.png

Step 4

Set the speed of both front and rear wheels on the left at the speed 50 and the right side at the speed 100, then set the car to stop while on logo down.

https://raw.githubusercontent.com/elecfreaks/learn-cn/master/microbitKit/Mecanum_wheel_car_kit/images/Mecanum%20wheel%20car%20kit_case_03_06.png

Program

Links: https://makecode.microbit.org/_8pwRqzKXsRWf

You can also download it directly:

Result

The car turns a circle towards the left while pressing button A, and stops while on logo down.

5.6. Exploration


5.7. FAQ


5.8. Relevant Files