# Stepper.h with motor shield R5

**URL:** <https://forum.arduino.cc/t/stepper-h-with-motor-shield-r5/589417>\
**Category:** Programming\
**Created:** [May 2, 2019, 3:39pm UTC](https://forum.arduino.cc/t/stepper-h-with-motor-shield-r5/589417 "2019-05-02T15:39:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daithik81](https://avatars.discourse-cdn.com/v4/letter/d/41988e/32.png) [@daithik81](https://forum.arduino.cc/u/daithik81)\
**Post date:** [May 2, 2019, 3:39pm UTC](https://forum.arduino.cc/t/stepper-h-with-motor-shield-r5/589417/1 "2019-05-02T15:39:46Z")

</div>

Hi,  
I've got a motor shield R3 with a uno R3 and was wondering if I can use the Stepper.h library with this board ?

I was trying to use some code like below but not sure if it will work with the motor shield

#include

const int stepsPerRevolution = 64; // change this to fit the number of steps per revolution  
// for your motor

// initialize the stepper library on pins 8 through 11:  
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

void setup() {  
// set the speed at 60 rpm:  
myStepper.setSpeed(60);  
// initialize the serial port:  
Serial.begin(9600);  
}

void loop() {  
// step one revolution in one direction:  
Serial.println("clockwise");  
myStepper.step(stepsPerRevolution);  
delay(500);

// step one revolution in the other direction:  
Serial.println("counterclockwise");  
myStepper.step(-stepsPerRevolution);  
delay(500);  
}

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 2, 2019, 4:05pm UTC](https://forum.arduino.cc/t/stepper-h-with-motor-shield-r5/589417/2 "2019-05-02T16:05:09Z")

</div>

> I've got a motor shield R3

A link, please.

In general, a motor controller for regular DC motors is not suited for controlling stepper motors.

---

<div class="post-metadata">

**Author:** ![Robin2](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/robin2/32/216045_2.png) [@Robin2](https://forum.arduino.cc/u/Robin2)\
**Post date:** [May 2, 2019, 4:08pm UTC](https://forum.arduino.cc/t/stepper-h-with-motor-shield-r5/589417/3 "2019-05-02T16:08:14Z")

</div>

> daithik81:  
> I was trying to use some code like below but not sure if it will work with the motor shield

The Arduino system is great for learning by doing.

There are thousands of different stepper motors. Post a link to the datasheet for the one you have.

AFAIK the motor shield is primarily intended for DC motors and would not be suitable for a high-current low-resistance stepper motor.

These links may help  
[Stepper Motor Basics](http://forum.arduino.cc/index.php?topic=284828.0)  
[Simple Stepper Code](http://forum.arduino.cc/index.php?topic=277692.0)

...R

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 11:48pm UTC](https://forum.arduino.cc/t/stepper-h-with-motor-shield-r5/589417/4 "2021-05-05T23:48:13Z")

</div>


