7
6.
Usage
The I2C Motor Driver can control motor which is based on the chip L298. The L298 is not just a dual motor
driver, it is a dual H-bridge. An h-bridge is basically a specific setup of transistors that allow you to switch
direction of current. Hooking up to a motor means you can have it spin in both directions; and with PWM
input, you can use your Arduino to make them spin at any speed. Because the L298 has 2 H-bridges, you
can make a robot turn around by spinning each wheel in different directions, and of course go forwards and
backwards.
Now, let's use the I2C Motor Driver to control two DC motors or a stepper rotating clockwise and
anticlockwise.
6.1
Set the address of the I2C Motor Driver
Set the address by dial switch is a new function added to the new I2C Motor Driver.
Then keep the address setup in the program the same as the address setup on the I2C motor
driver. The default address setup in the program is 0x0f.
#define I2CMotorDriverAdd 0x0f // Set the address of the I2CMotorDriver