Custom blocks for WEMOS I2C Motor Shield for micro:bit. These shields can be bought from AliExpress as cheap as 1.5€
The shipped firmware with the Motor Shield is bugged. You need to update it with danielfmo/wemos_motor_shield.
This package contains a block for driving standard motors forwards and backwards, with a speed setting of 0-100%:
WEMOS_Motor_Shield.motorOn(WEMOS_Motor_Shield.Address.Address0x30, WEMOS_Motor_Shield.Motors.MotorA, WEMOS_Motor_Shield.MotorDirection.Forward, 10)
WEMOS_Motor_Shield.motorOn(WEMOS_Motor_Shield.Address.Address0x30, WEMOS_Motor_Shield.Motors.MotorB, WEMOS_Motor_Shield.MotorDirection.Reverse, 100)
Individual motor outputs can also be turned off by cutting power
WEMOS_Motor_Shield.motorOff(WEMOS_Motor_Shield.Address.Address0x30, WEMOS_Motor_Shield.Motors.MotorA)
or by shorting motor contacts (for braking)
WEMOS_Motor_Shield.brakeMotor(WEMOS_Motor_Shield.Address.Address0x30, WEMOS_Motor_Shield.Motors.MotorA)
This package also contains block which turns off all motor outputs and leaves shield in standby mode:
WEMOS_Motor_Shield.allOff(WEMOS_Motor_Shield.Address.Address0x30)
MIT
Extension I2C bus code is based on the WEMOS Motor Shield Arduino library released by danielfmo.
Extension structure is based on the Blocks for driving the Kitronik All-in-one Robotics Board.
- for PXT/microbit (The metadata above is needed for package search.)