Getting started with the motor shield

Hi,

I was playing around with the motor shield yesterday, but I was confused by the pin layout of the shield. On the bottom right, there are the pins with screws to fasten the DC motors, but it is a bit unclear to me how to fasten a battery, and why there are so many other pins on the shield.

Does anyone have a pointer how to setup the motor shield with a small DC motor. For the sketch, I just would use analogWrite(...) to generate the PWM signal?

Thanks!

When you refer to "a" motor shield as "the" motor shield you make it sound as if there is only one make and model, which of course is not the case. It would be a good idea to identify it.....

I was playing around with the motor shield yesterday

The arduino one?

Regards

Hi, would be good if you can post a pic of it please.

Please read;

http://forum.arduino.cc/index.php/topic,148850.0.html

Tom..... :)

farsi: Hi,

I was playing around with the motor shield yesterday, but I was confused by the pin layout of the shield. On the bottom right, there are the pins with screws to fasten the DC motors, but it is a bit unclear to me how to fasten a battery, and why there are so many other pins on the shield.

Bottom right of what? There are literally 1000's of different motor driver boards out there that could be used, and dozens of Arduino shields to drive motors, many with several versions/revisions.

...... and for all of them, there will (theoretically)be a datasheet and in many cases, sample Arduino code either from the makers or in the Playground

How about posting a link for the item in question when you have questions. There are plenty of photos online with pin labels clearly visible. Have you looked at the schematic ?

The arduino one?

I mean: the one from arduino? :cold_sweat: :cold_sweat:

Sorry for the missing information in the initial post.

This is my setup

I got the motor moving with an Arduino UNO instead of the Arduino Yun (hmm… something feels buggy with my Yun…)

In any case, the main question was how to map the pins from the Arduino to the pins on the shield. The main motor pins are clear now, and luckily I found http://www.instructables.com/id/Arduino-Motor-Shield-Tutorial/step4/One-Motor/

But on the shield are many more pins (the mail header pins e.g.). what are they for?

15250167567_e240ac390a_z.jpg

Hi, look here.

http://arduino.cc/en/Main/ArduinoMotorShieldR3

And download the schematic, it should tell you all you need to know.

Tom...... :)

const int AMDir = 12;
// AMDir: Digital direction (rotation sense) output pin assigned to the "A" motor. The pin assignment is not free, as the motor shield has the pins assigned (12: motor A; 13: motor "B". By convention, the forward movement HAS to correspond to the HIGH value in this pin; rewire if not)

const int AMotPWM = 3;
// AMotPWM: Digital output pin assigned to the "A" motor. The pin assignment is not free, as the motor shield has the pins assigned (3: PWM motor A; 11: PWM motor "B". Both signals are boosted by the board to the LSP1/2/3/4 terminals)

const int BMDir = 13;
const int BMotPWM = 11;

Hope it helps.

Regards