Motorcycle-MakeCode - Micro:bit
micro:bit x 1
Motor x 1
Bricks x N
Insert the micro:bit to Wukong expansion and connect the motors to M1 and M2 ports accordingly.
Build the bricks as the picture shows:
Go to the MakeCode coding page:（https://makecode.microbit.org/#editor） Add wukong extension package, click extension in the menu of settings on the right upper side.
Search with“wukong”to download it .
Now let us go to the coding page: Drag show icon brick into on start.
Controlling the turning direction through button A and B. While button A being pressed, set the speed of M1 at 0, and M2 at -100, thus to make the car turn right; Then use the same way to code the car to turn left.
While button A&B being pressed, set the speed of M1 at 100 and M2 at -100.
While the screen facing to the ground, set the speed of M1&M2 at 0.
Press button A to turn the car left and button B to turn the car right; press both A&B to drive the car forward; While the screen facing to the ground, the car stops moving.
Share this post
About the Author
ELECFREAKS focus on microbit and release interesting articles
Welcome global microbit enthusiasts to contribute
- Micro bit supplier
- Wholesale Suppliers
- Micro bit tutorial
- Micro bit classroom pack
- Mcorbit Environment Monitoring
- TPBot car
- Micro:bit car
- AI Lens
- Micor:bit AI Lens
- Microbit gyroscope
- Micro:bit LEDs
- BBC micro:bit
- Micro:bit Manipulator
- Wukong board
- Micro:bit Motorcycle
- Nezha breakout
- Micro:bit DIY