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.
crickit run motor block into the
- Adjust the speed by changing the percentage.
- Motor will run forever.
- If the motor is going the wrong way, use a negative percentage.
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.
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.