Data Sheet
Microsoft MakeCode Blocks Editor Code
The program shown to the right was created using the Microsoft MakeCode
Blocks Editor for the BBC micro:bit. It demonstrates the control of stepper
motors, normal motors and servos, all of which can be connected to the
All-in-one Robotics Board.
When Button A on the BBC micro:bit is pressed, a stepper motor connected to
motor outputs 1 and 2 will turn in the forward direction 180°; ordinary motors
connected to motor outputs 3 and 4 will turn in opposite directions (Motor 3 at
10% speed, and Motor 4 at 100%); a servo connected to servo output 1 will turn
to the 180° position if it is a standard servo, or will turn full speed in one
direction if it is a continuous rotation servo; and finally, a servo connected to
servo output 8 will turn to the 0° position, or will turn full speed in the opposite
direction to Servo 1.
When Button B on the BBC micro:bit is pressed, Stepper 1 will turn 100 steps in
the opposite direction to Button A (the stepper motor block allows turning to be
set in either a certain number of degrees or steps; the default number of steps is
200, but this can be changed using the block shown in the ‘On Start’ section);
Motor 3 will be turned off; Motor 4 will turn in the opposite direction to Button
A at 50% speed; and finally, servos connected to servo outputs 3 and 6 will be
set to the 90° position.
When Buttons A and B on the BBC micro:bit are pressed together all motor and
servo outputs on the All-in-one Robotics Board will be switched off.
In the same way as the stepper motor steps value can be changed, if the
Robotics Board I2C chip address has been changed, a new address can be
selected in the package – see the ‘robotics.ts’ file in the MakeCode package for
instructions.
Note: These programs use the Kitronik Robotics Board package available on
Microsoft MakeCode (the green blocks shown here).
All-in-one Robotics Board for BBC micro:bit
www.kitronik.co.uk/5641