Datasheet

8
6.2 How to drive 2 DC motors
Note:
The first thing to notice however, is that you need an external power source for your DC motors. The 5v pin
on the Arduino cannot provide enough power to drive 2 motors, you may damage your Arduino if you do
so.
And then program your Arduino as below:
#include <Wire.h>
.......
.......
< Driver functions >
.......
.......
void setup() {
Wire.begin(); // join i2c bus (address optional for master)
delayMicroseconds(10000); //wait for motor driver to initialization
}
void loop() {
while(1) {
MotorSpeedSetAB(100,20);
delay(10); //this delay needed
MotorDirectionSet(0b1010); //0b1010 Rotating in the positive direction