Do you have a question about the Motor Shield V2.0 and is the answer not in the manual?
Questions and answers
Summary of Contents for Adafruit Motor Shield V2.0
Page 1
Motor Shield V2.0 Introduction Note This document works for Motor Shield V2.0/2.1/2.2. The Motor Shield is a driver module for motors that allows you to use Arduino to control the working speed and direction of the motor. Based on the Dual Full-Bridge Drive Chip L298, it is able to drive two DC motors or a step motor.
Specifications Spec Value Operating Voltage External Power 6-15V Output Current 2.0A Max @ Each Channel PWM Range 0-100% Output 2 Channels, 4 Ports Hardware Overview 1.Channel 1 indicator, include 3 leds • EB - channel 1 enable, high active • IN3 - status of OUT3 •...
Page 3
3.OUTPUT - There’re 2 channels, each channel has 2 output • Channel 0 - OUT1, OUT2 • Channel 1 - OUT3, OUT4 4.Channel 0 Sense 5.Channel 0 indicator, include 3 leds • EB - channel 0 enable, high active • IN1 - status of OUT1 •...
Arduino Pin Function Not Used OUT1 Enable of Channel0 Enable of Chennel1 OUT2 OUT3 OUT4 Note D8~D13 was used by Motor Shield. Please don’t use those pins to avoid conflict. Analog Pin Used Arduino Pin Function Not Used Not Used Not Used Not Used Not Used...
Page 5
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. •...
Page 6
void loop() motor.speed(0, 100); // set motor0 to speed 100 delay(1000); motor.brake(0); // brake delay(1000); motor.speed(0, -100); // set motor0 to speed -100 delay(1000); motor.stop(0); // stop delay(1000); // END FILE Then you will find your motor move (1s), stop (1s), move back (1s), stop (1s), and loop.
Page 7
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 to use an external power. Find the pin definitions of you stepper, and connect it to the OUTPUT of the shield. As below: Stepper Motor Shield...
Page 8
digitalWrite(10, HIGH); stepper.step(steps); digitalWrite(9, LOW); digitalWrite(10, LOW); void setup() // set the speed of the motor to 30 RPMs pinMode(9, OUTPUT); pinMode(10, OUTPUT); digitalWrite(9, LOW); digitalWrite(10, LOW); stepper.setSpeed(30); void loop() step(1000); step(-1000); // END FILE If there’s nothing happen, please double check if you had connected the wire right. Library APIs begin Description...
Page 9
speed Description Set speed, control by PWM. void move(int motor_id, int speed); • motor_id • 0 - Chanel 0 • 1 - Chanel 1 • speed: -100~100, the larger the faster, 0 for stop stop void stop(unsigned char motor_id); brake void brake(unsigned char motor_id);...
Need help?
Do you have a question about the Motor Shield V2.0 and is the answer not in the manual?
Questions and answers