kidsbits blocks coding TB6612 2-way Motor Drive module is fully compatible with kidsbits control board and Lego building blocks.
You can easily connect it to kidsbits control board for communication using an RJ11 cable without worrying about wrong connection and damage.
This module comes with a N20 metal motor, which is driven by HR1124S chip.
Connect the motor module to control board to rotate the metal motor. It can randomly control the turning direction and rotating speed of motor.
Follow the instruction mentioned below to learn how to use this module.
2. Technical Parameters
- Supply voltage: DC 5V
- Drive chip: HR1124S
- Rated speed: 500rpm
- Reduction ratio: 1:30
- Axis length: 3*10±0.2mm
3. Wiring Diagram
4. Import kidsbits library
Begin with the Mixly blocks coding, you should first import the corresponding kidsbits library for those sensor modules.
Connect the control board to your computer using a USB cable.
Then open the Mixly blocks software 0.998, set the board to UNO R3, select your correct COM port. On the upper right corner you can switch the language.
After that, click Import, import the keyes-kidsbits library. Shown below.
If import custom library successfully, you should see the sensor module library shown below.
Click on the control output block of keyes_kidsbits, you can directly use the corresponding module. Shown below.
Note: below is two methods for testing the code
- Testing by the blocks , only use two digital ports to control the forward and backward rotation of motor; can’t adjust the speed; the default speed is maximum.
- Testing by the blocks , use one digital port and a PWM port to control the motor; can randomly control the motor’s direction and rotating speed; use the PWM value of PWM port to control the motor’s rotating speed.
5. Upload Code
Open the code folder we provided, you are able to directly open or drag the code to Mixly window.
You can click the Code to check the C language.
6. Test Result
Upload the code success, then open the monitor and set the baud rate to 9600. you should see the pop-up value showed below.
The motor will turn forward; the greater the value, the faster the motor’s rotating speed. Then the motor turns backward; the greater the value, the slower the motor’s rotating speed.