Example Code for micro:bit-Motor Rotation

Last revision 2025/12/08

This article provides an example code and complete setup instructions for rotating motors with micro:bit, including necessary hardware and software preparations, wiring diagram, and sample code to facilitate learning and application in robotics projects.

Hardware Preparation

Software Preparation

Makecode online programming address: https://makecode.microbit.org.

Please copy the library link address and paste it into the Makecode extension to search: https://github.com/DFRobot/pxt-DFRobot_creative-robotics-kit

Wiring Diagram

Other Preparation Work

Copy the library link address https://github.com/DFRobot/pxt-DFRobot_creative-robotics-kit and paste it into the Makecode extension to search and add the library.

Sample Code

Result

Was this article helpful?

TOP