Guide

1/22/2018 micro:bot Kit Experiment Guide - learn.sparkfun.com
https://learn.sparkfun.com/tutorials/microbot-kit-experiment-guide/all#about-the-motobit-board 44/75
Code to Note
On Button Pressed
The On Button Press is an event function. Any code blocks that are placed inside of the block will only execute
when that event happens. In this block when the A button is pressed on your micro:bit your robot will start moving.
When it gets to the end of the program it will stop again until you press the A button again.
Turn Motors
The Turn Motors block gives you the ability to turn the motors ON or OFF in software. They are naturally OFF ,
so anytime you want to drive motors, you need to set them to ON . A good practice is to turn them OFF when your
robot completes its task or should not be moving for long periods of time, this saves batteries and wasted power
consumption.
Move Motors At
The Move Motors block is the basis of the moto:bit software package. You use this block by selecting which motor
you want to control (RIGHT or LEFT), its direction (FORWARD or REVERSE) and the throttle / power percentage you
would like the motor to spin at (0-100%). For your bot to move forward you need to have both motors drive in the
same direction. To turn, or pivot, you set the motor directions in an opposite configuration.
Pause