bitty controller micro:bit code

MakeCode project for MakerBit Smart Car

controlling the MakerBit Smart Car

The MakerBit Smart Car has a BBC micro:bit connected to it via its edge connector. Switching specific edge connector pins on or off causes either or both of the motors which drive the Smart Car's wheels to be switched on and running either forwards or backwards or to be stopped completely. Other pins control the speed the motors run at. The different combinations of pin state and the actions they cause are summarised in the following table:

PIN 11 PIN 12 PIN 13 PIN 14 PIN 15 PIN 16 EFFECT
0 0 0 0 0 0 All motors off
1 0 Motor A forwards
0 1 Motor A backwards
0 0 Motor A off
0 0 0 0 0 0 All motors off
1 0 Motor B forwards
0 1 Motor B backwards
0 0 Motor B off
1 or PWM 0-255 Motor A speed
1 or PWM 0-255 Motor B speed

Code

Note that you may have trouble switching to Blocks view because of a bug in the MakeCode editor.

For use with the Bitty Controller Touchpad UI

For use with the Bitty Controller D-Pad UI