/pxt-motorbit

ElecFreaks (摩比特) MakeCode motor:bit package for micro:bit. Works with motor driver boards too.

Primary LanguageTypeScriptMIT LicenseMIT

Motor:bit Package

This ElecFreaks Motor:bit package was developed by ElecFreaks with minor assistance from Tinkercademy.

The ElecFreaks Motor:bit is an integrated motor driver and breakout board for the BBC micro:bit. With an integrated motor driver chip TB6612, your micro:bit can drive two DC motors with 1.2A max single channel current.

The Motor:bit also features the Octopus series "GVS" connectors, allowing for easy direct connection to compatible Octopus sensors and outputs. Among these connectors, P0, P3-P7, P9-P10 support sensors with 3.3V power voltage only; P13-P16, P19-P20 support 3.3V or 5V sensors. You can change the output voltage by sliding the switch on the board.

If you're using your own breakout board or motor driver, connect your driver such that P8 and P12 control direction, and P1 and P2 control speed.

Code Example

basic.forever(() => {
    motorbit.forward(70)
    basic.pause(2000)
    motorbit.back(50)
    basic.pause(2000)
    motorbit.turnleft(50)
    basic.pause(2000)
    motorbit.turnright(50)
    basic.pause(2000)
    motorbit.brake()
    basic.pause(2000)
    motorbit.freestyle(-40, 30)
    basic.pause(2000)
})

License

MIT

Supported targets

for PXT/microbit (The metadata above is needed for package search.)