Motor Driver
This documentation includes installation guidelines and sample code for your hardware.
Overall Info
The TC78H630FNG is H-bridge driver IC for DC motors.
Driver Connections
Left Motor Driver
nStand By: D1
Forward PWM: D3
Reverse PWM: D2
Right Motor Driver
nStand By: D0
Forward PWM: D5
Reverse PWM: D4
Power
Logic: VCC (+3.3V) and GND.
Motor: Motor In and GND.
Specifications
TC78H630FNG's technical specifications are as follows:
Input Voltage: 15V Max.
Output Current: 1.6A Max.
Control Logic Frequency: 500kHz Max.
Arduino Library
Turta_MotorDriver library is responsible for controlling the motor drivers.
To use the library on Arduino IDE, add the following #include statement to the top of your sketch.
Then, create an instance of the Turta_MotorDriver class.
Now you're ready to access the library by calling the md instance.
Initialization
To initialize the module, call the begin method.
This method configures the GPIO pins to control motors.
Basic Members
Driver Motors
Drives the motors in desired speed and directions.
Parameters
int16_t leftSpeed: Left motor speed. -255 to 255. 0 is coast.
int16_t rightSpeed: Right motor speed. -255 to 255. 0 is coast.
Returns
None.
Coast Motors
Coasts (stops) the motors without braking.
Parameters
None.
Returns
None.
Brake Motors
Brakes the motors.
Parameters
None.
Returns
None.
Examples
You can open the example from Arduino IDE > File > Examples > Examples from Custom Libraries > Turta MKR Motor Shield. There is one example of this sensor.
Motor Driver Demo
This application demonstrates motor control capabilities of the drivers.
To run the example:
Open the Motor Driver Demo sketch from the examples menu.
Select your Arduino MKR series board from the Tools > Board menu.
Select your device's COM port from Tools > Port menu.
Upload the code to your device.
Sample Code
Result
After the application is uploaded to the device, it demonstrates different motor speed and directions.
The application runs forever until you clear it from memory.
Last updated