THe Code
link: https://makecode.com/_6hmRWEhhoi7A
The motor card is similar to the LED code. When the button A is pressed, the code digital writes A3 to HIGH, which will trigger the transistor on the card to turn the motor. To turn off, you press button B, which will digital write A3 to LOW and stop turning the motor.