25. Case 23: The Locomotive¶
25.3. Materials Required¶
25.4. Bricks build-up¶
25.5. Hardware Connection¶
Connect a motor to M1 port on Wukong breakout board.
25.7. Coding¶
Add extensions¶
Click “Advanced” in the MakeCode to see more choices.
Search with Wukong in the dialogue box to download it.
Program¶
Result¶
When button A is pressed, the locomotive moves forward; when button B is pressed, the locomotive moves backward; when button A+B is pressed, the locomotive stops moving.