The use of Motors in MakeCode for Circuit Playground Express and MakeCode for micro:bit are identical - the blocks look a bit different but the functions are 100% the same between versions.

With Crickit support in MakeCode, you should have a green CRICKIT block group available. Clicking on that group pops out various blocks for Crickit capabilities including those related to motor control as shown below.

Move a Motor Forward

Drag the crickit run motor block into the Forever loop

  • Adjust the speed by changing the percentage.
  • Motor will run forever.
  • If the motor is going the wrong way, use a negative percentage.

Stop and Start using Circuit Playground Buttons

You can use the on button click event blocks to make quick interactive motor movements:

In this example above, one button makes the motor run. The other button will make the motor stop.

Using the Circuit Playground Slide Switch to Change Motor Direction

The set motor inverted block changes the motor direction without having to swap wires. Add the following blocks to utilize the slide switch to change the motor direction.

What if your motor goes backwards? If you'd like to switch the direction permanently without changing code, switch the wires around from the motor to Crickit.

This guide was first published on Jul 04, 2018. It was last updated on Mar 08, 2024.

This page (MakeCode) was last updated on Mar 08, 2024.

Text editor powered by tinymce.