Arduino shield L293D

Hi all
I'm new in the world of arduino, I bought arduino shield L293D and connected it to arduino uno but I can not find the proper code to make it work with a stepper mottor.
Please help me in details how to deal with this proplem.

Can you give a link to the shield you bought? Do you need to install any libraries?

this is the link to the shield i bought

  1. Before we care about the code, post a picture of your setup (wiring).
  2. What stepper motor do you use (datasheet or precise product name)?
  3. Did you make sure that you connected the right coil pairs (assuming you are using a bipolar stepper)?

the product name of the stepper motor is:
stepping motor (MITSUMI) M35sp-7N
Lot no.T M8319

i make sure that the coil pair s are connected right as per their order

i tried to post you the photos for the motor and for the connection but i failed, i don't know why.
i am waiting for your reply, or any other

just upload the photos as attachment to your next reply;
I tried to find some data about your motor, but seems to be not easy.

Do you have the 6V or 24V version of the motor?

the motor is 6V, and you can search by the following key word (MITSUMI M35sp-7N M8319), you can find my type of motor at the following page:

because i am trying again to upload the image but it give me error.

the code i am trying to use is:

AF_Stepper motor(200, 2);
void setup()
// put your setup code here, to run once:
Serial.println(“Stepper test!”);
motor.setSpeed(4 00); // 50 rpm

void loop() {
// put your main code here, to run repeatedly:

Serial.println(“Micrsostep steps”);
motor.step(50, FORWARD, MICROSTEP);
motor.step(50, BACKWARD, MICROSTEP);
motor.step(100, FORWARD, MICROSTEP);
motor.step(100, BACKWARD, MICROSTEP);
motor.step(200, FORWARD, MICROSTEP);
motor.step(200, BACKWARD, MICROSTEP);
motor.step(250, FORWARD, MICROSTEP);
motor.step(250, BACKWARD, MICROSTEP);

motor.step(3, FORWARD, MICROSTEP);
motor.step(3, BACKWARD, MICROSTEP);


what is the error with this code

Well when following the link you provided, there appears to be a bold, blue button on the page that installs a library needed for this shield.

i installed the library needed for the shield, and put the folder in the c://program files/Arduino/libraries

what should i do else, i don't know

If you want to use a library, then you have to tell the IDE what name it has and where to find.
After having installed it in the “normal” library path/folder, you include the library at the very beginning of your code, e.g.

#include <your_library_name.h>


  1. don’t forget the <> and the .h
  2. there is NO ; at the end of the command line

So, in your project:

#include <AFMotor.h>
// Motor with 200 steps per rev (1.8 degree)
// to motor port #2 (M3 and M4)
AF_Stepper motor(200, 2);

When you want to have success with programming an Arduino, you should learn about the basics …

final_shield.ino:9:1: error: stray '' in program
final_shield.ino:16:1: error: stray '' in program
final_shield.ino: In function 'void setup()':
final_shield.ino:9:17: error: 'u201cStepper' was not declared in this scope
final_shield.ino:10:18: error: expected ')' before numeric constant
final_shield.ino: In function 'void loop()':
final_shield.ino:16:17: error: 'u201cMicrsostep' was not declared in this scope
Error compiling.

when i follow all instructions you told me, the program send me the previous message.

Well those are just your personal issues with the code you have… Post the most recent edition of your code in code </> tags.

PLs post your complete code, not only fractions or errors
Did you explicitely make sure you installed the AFMotor library correctly?

My recommendation:

  1. re-install the library and make sure that it is installed correctly by:
  2. deleting the "include" command at the top of your sketch
  3. include the library at the top of your code by using the Arduino menu (Sketch/Library or similar - I have a different language version
  4. If you can't include the library this way - there is something wrong with the installation of the library

Read this:

Where to Install your Libraries


i followed all the instruction for installation library carefully but it gives me error again.

1- the location of the library of the shield is:

2- the code is:
// ConstantSpeed.pde
// -- mode: C++ --
// Shows how to run AccelStepper in the simplest,
// fixed speed mode with no accelerations
// Requires the AFMotor library (GitHub - adafruit/Adafruit-Motor-Shield-library: Adafruit Motor shield V1 firmware with basic Microstepping support. Works with all Arduinos and the Mega)
// And AccelStepper with AFMotor support (GitHub - adafruit/AccelStepper: A small fork of AccelStepper v1.3 with AF_motor (Adafruit motor shield) support!)
// Public domain!

#include <AccelStepper.h>
#include <AFMotor.h>

AF_Stepper motor1(200, 1);

// you can change these to DOUBLE or INTERLEAVE or MICROSTEP!
void forwardstep() {
motor1.onestep(FORWARD, SINGLE);
void backwardstep() {
motor1.onestep(BACKWARD, SINGLE);

AccelStepper stepper(forwardstep, backwardstep); // use functions to step

void setup()
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println(“Stepper test!”);


void loop()

3- the error message is:

AFMotor_ConstantSpeed.pde:10:26: fatal error: AccelStepper.h: No such file or directory
compilation terminated.

Please use code </> tags for your code.

‘No such file or directory’ regarding a library means you probably installed it incorrectly.

I think you have to learn some "fundamental basics", before you go on.
Learn to install a library first before you deal with stepper motors.

Sorry, but you have apparently no idea and didn't even click the link which @LarryD posted.
We will give you hints where and how to fish, but you have to catch the fish yourself.

In addition to what I said before:

  • you are now using a second library (AccelStepper) in combination with the AFMotor lib.
    This is only possible if:
  1. you have a special L293D shield which is compatible with both libraries (-> v2.0)
  2. you combine a special AccelStepper lib version with AFMotor lib (see this link)
  3. you install all libraries correctly
  4. your code uses the right syntax for accelstepper

In you most recent posting you refer to a library address beginning with http://...
I hope you don't think that you installed a library by just referring to a URL ??