44
control output terminals; STBY is normal working/standby state control pin; VM (4.5~15 V) and VCC ( 2.7
to 5.5 V) are the motor drive voltage input and the logic level input, respectively.
In the Arduino, the analog voltage cannot be output, and only the digital voltage value of 0 or 5V can be
output. We use the high-resolution counter to modulate the square wave's duty cycle to the level of a specific
analog signal. Encode. The PWM signal is still digital because at any given time, the full-scale DC supply is
either 5V (ON) or 0V (OFF). The voltage or current source is applied to the analog load in a repeating pulse
sequence of ON or OFF. When the DC power is applied to the load, the power is disconnected when the
power is turned off. Any analog value can be encoded using PWM as long as the bandwidth is sufficient.
The output voltage value is calculated by the on and off times. Output voltage = (on time / pulse time) *
maximum voltage value, Figure 4-4-2 is the voltage corresponding to the pulse change.
Figure 4-4-2 Pulse vs. Voltage
For detailed use of the chip, please refer to
“
Datasheet\TB6612FNG.pdf
”
4.4.2 Motor Test Procedure
Figure 4-4-3
As shown in Figure 4-4-3, I only used the M1 and M2 motor interfaces in the car. So just use the motor
1, 2 in the program. Num represents the motor serial number
Emakefun_DCMotor
*
DCMotor_1
=
mMotorDriver
.
getMotor
(
num
);