Chilling out, it occurs to me that what I can do for these little thongs. Recently, I find many motors, so I make a series of trains.
It is set up with building blocks.
Printed by 3D printer.
Transformed from old toys.
The methods of controlling the little car to walk are same basically, controlling the movement in the four directions. Now, the two wheels drive structure is needed to realize the movement through controlling the rotation direction of the two wheels. Of course, auxiliary wheels are also needed so that the car can keep balance.
Step 1：Materials preparation
Bill of material
According to the needy function list, choose the corresponding modules and components.
Stick motor and Lego together with 502(a kind of glue).
Modify the motor line, and connect 1.27-spacing line to the motor, which will make it convenient for the connection to the motor module. Ring the point of junction with heat shrinking tubing in order to prevent the short circuit.
Stack all modules used together, and connect the battery to the BM module, and the two motors to Motor module. It is assembled.
Step 3：Program debugging
The program is so simple, with just 51 lines, because of the advantage of the libraries.
Analysis of Bluetooth serial ports
Protocol ProtocolB(&Serial1, TYPE_NUM);
Data channel control
throttle = map(Data, 1000, 2000, 255, -255);
steering = map(Data, 1000, 2000, 255, -255);
MotorLeft.Driver(MotorLeft.GetData(throttle, steering, CHAN_LEFT));
MotorRight.Driver(MotorRight.GetData(throttle, steering, CHAN_RIGHT));
There are 8 data channels of App control, during which only 2 are needed in the process of control. They are 1 and 0 here, or others are also ok.
If you have trouble in programming, there is no problem to use graphical programming.
Then you can enjoy the experiment, which is so cute.
The 3D printed car is made of two motors. It is enough to make the structure of the car with 3D modeling.
The difference of the modules list is that the Base power supply baseboard is used as the power supply this time.
Code debugging is same, so I won’t say it anymore.
The old toy transformation is base on a car chassis, so the structure has basically been set. In terms of fixing modules, laser cutting is the fastest.
Rhino is used to draw the plan here, and you can use other software. Finally, export DXF file to cut.
Bill of material and debugging are same with the 3D printed car, which won’t be said anymore.
Program download address
For iphone, search mRobots in APP store.
Download for Andriod：MTank