![Adafruit Motor Shield V2.0 Скачать руководство пользователя страница 7](http://html1.mh-extra.com/html/adafruit/motor-shield-v2-0/motor-shield-v2-0_manual_2845849007.webp)
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
A+
OUT1
A-
OUT2
B+
OUT3
B-
OUT4
Then open
stepper_test
example in the library, upload it to Seeeduino V4, then you
will find your stepper move.
/*
* Stepper test for Seeed Motor Shield V2
* loovee @ 15 Mar, 2016
*/
#include <Stepper.h>
// change this to the number of steps on your motor
#define STEPS 200
// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper
stepper
(STEPS, 8, 11, 12, 13);
// the previous reading from the analog input
int
previous = 0;
void
step
(
int
steps)
{
digitalWrite(9, HIGH);