Approved content

The content below is provided by a partner.

kitronikltd/pxt-kitronik-motor-driver 0.0.8 GitHub

Kitronik blocks for micro:bit

Blocks that support Kitronik kits and shields for the micro:bit This package is for the Motor Driver Board and Compact Motor Driver Board

Motors

input.onButtonPressed(Button.A, () => {
    kitronik_motor_driver.motorOn(kitronik_motor_driver.Motors.Motor1, kitronik_motor_driver.MotorDirection.Forward, 100);
    kitronik_motor_driver.motorOn(kitronik_motor_driver.Motors.Motor2, kitronik_motor_driver.MotorDirection.Reverse, 100);
})
input.onButtonPressed(Button.B, () => {
    kitronik_motor_driver.motorOn(kitronik_motor_driver.Motors.Motor1, kitronik_motor_driver.MotorDirection.Reverse, 100);
    kitronik_motor_driver.motorOn(kitronik_motor_driver.Motors.Motor2, kitronik_motor_driver.MotorDirection.Forward, 100);
})
input.onButtonPressed(Button.AB, () => {
    kitronik_motor_driver.motorOff(kitronik_motor_driver.Motors.Motor1);
    kitronik_motor_driver.motorOff(kitronik_motor_driver.Motors.Motor2);
})

License

MIT

Supported targets

kitronik-motor-driver=github:kitronikltd/pxt-kitronik-motor-driver#v0.0.8