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 73/75
Don’t be overwhelmed by everything this code has to offer! I know it looks rather menacing, but the truth is that you’ve
already done all of this code in previous experiments.
Servo Write Pin to
The Servo Write Pin to block is found under the Pins drawer and it accepts a pin number that you have a servos
signal wire attached to as well as an angle that you want it to rotate to. That’s the basics for controlling a servo motor
with Microsoft MakeCode!
On Button A, On Button B and On Button A+B
In this example we use the On Button event blocks a lot. They allow us to break out different functions we want
without messy if statements.
In this program the On Button A event block resets the calibration value for the table surface for the robot to use as
a comparison value and also sets the servo positions to 90 degrees.