![Adafruit Motor Shield V2.0 Manual Download Page 5](http://html1.mh-extra.com/html/adafruit/motor-shield-v2-0/motor-shield-v2-0_manual_2845849005.webp)
Drive a DC Motor
You can drive 2 DC motor with this shield. Here I will show you how to drive a DC
motor.
You need to do some preparing first:
•
Set
SEN_A
and
SEN_B
, connect the left 2 pins together with a jumper.
•
Connect
MB_EN
together with a jumper, as we are no going use an external power.
•
Connect your DC motor to Chanel 0 (OUT1 and OUT2).
Then open
motor_dc
example in the library. Upload the code to Seeeduino V4.2.
// Demo function:The application method to drive the DC motor.
// Author:Loovee ([email protected])
// 2016-3-11
#include "MotorDriver.h"
MotorDriver motor;
void setup()
{
// initialize
motor.begin();
}