Connection
To connect the module to the universal fixture, we will use a wire with a six-pin IDC connector. First, connect the flat six-core wire with an IDC connector to the universal fixture at position 1 and then connect the other side to the module. The IDC connector has a groove on one side, so it can only be connected in one direction.
Programme
Basic program
The motor can be programmed very easily and this program shows how. Since the motor is connected to the first position of the universal fixture, we work with pin 14. Using simple commands, we can write the logical values 1 (on) and 0 (off) to this pin, thereby controlling the motor. In the sample program, the motor is turned on and off by pressing the A or B buttons on the micro:bit.
In addition to simple digital control, the motor can also be controlled analogically. By simultaneously pressing the A + B buttons, an analog value corresponding to 50% of the power is written to the pin, which causes the motor to spin at half speed. This allows you to adjust the rotation speed according to the needs of the project.



