4. Case 02: Drifting Left&Right#

4.1. Purpose#


  • Programme to make Wonder Rugged Kit drift left or right.

4.2. Materials#


  • micro:bit Wonder Rugged Kit

4.3. Background Knowledge#


4.4. Software#


MicroSoft makecode

4.5. Program#


Step 1#

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

../../_images/Mecanum_wheel_car_kit_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.

../../_images/Mecanum_wheel_car_kit_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.

../../_images/Mecanum_wheel_car_kit_case_01_03.png

Step 3#

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

../../_images/Mecanum_wheel_car_kit_case_02_05.png

Step 4#

Set the car moving forward while pressing A+B , drifting to left while on tilt right , to right while on tilt left and stopping while on logo down.

../../_images/Mecanum_wheel_car_kit_case_02_06.png

Program#

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

You can also download it directly:

Result#

Set the car moving forward while pressing A+B , drifting to left while pressing button A , to right while pressing button B and stopping while on logo down.

4.6. Exploration#


4.7. FAQ#


4.8. Relevant Files#