user37233: I am trying to control this OWI Robotic Arm using the Arduino's digital outputs (I am using pins 12 & 13).
If I wire up the wires to ground and 5V it goes one way, if I switch the wires, it goes the other way. However when I have the pins wired up to the digital pins, it does not work, but the on-board LED does blink.
The code:
int a = 12;
int b = 13;

void setup() {
  // put your setup code here, to run once:
  pinMode(a, OUTPUT);
  pinMode(b, OUTPUT);
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  //up
  digitalWrite(a, LOW);
  digitalWrite(b, HIGH);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(500);
  //down
  digitalWrite(b, LOW);
  digitalWrite(a, HIGH);
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
}


user3134: The problem you are seeing here is that the Arduino can provide nowhere near as much current through I/O pins as it can power. Quoting from the Arduino website:

DC Current per I/O Pin: 40 mA

This means that each pin can power maybe a couple of LEDs, and that's it. Additionally, motors provide "back-EMF": When opening (cutting power) an inductive load (e.g. a motor), the current wants to keep going. This will damage whatever just opened unless protection is used. So, I wouldn't be surprised if you damaged your Arduino by attempting to drive a motor with it.
So, what can you do? Use an H-Bridge. This circuit will allow you to easily control a motor & its direction. Many circuits can be found online, but an easy solution is a cheap L298N module, which can be as cheap as $3 a piece. This will safely & easily control the arm. Connecting your Arduino with the following circuit & using your existing sketch will make it work.

simulate this circuit – Schematic created using CircuitLab

37233: <p>I am trying to control <a href="http://rads.stackoverflow.com/amzn/click/B0017OFRCY" rel="nofollow noreferrer">this OWI Robotic Arm</a> using the Arduino's digital outputs (I am using pins 12 &amp; 13).</p>

<p>If I wire up the wires to ground and 5V it goes one way, if I switch the wires, it goes the other way. However when I have the pins wired up to the digital pins, it does not work, but the on-board LED does blink.</p>

<p>The code:</p>

<pre><code>int a = 12;
int b = 13;

void setup() {
  // put your setup code here, to run once:
  pinMode(a, OUTPUT);
  pinMode(b, OUTPUT);
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  //up
  digitalWrite(a, LOW);
  digitalWrite(b, HIGH);
  digitalWrite(LED_BUILTIN, HIGH);
  delay(500);
  //down
  digitalWrite(b, LOW);
  digitalWrite(a, HIGH);
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
}
</code></pre>
 3134: <p>The problem you are seeing here is that the Arduino can provide <em>nowhere</em> near as much current through I/O pins as it can power. Quoting from <a href="https://www.arduino.cc/en/Reference/Board" rel="nofollow noreferrer">the Arduino website</a>:</p>

<blockquote>
  <p>DC Current per I/O Pin: 40 mA</p>
</blockquote>

<p>This means that each pin can power maybe a couple of LEDs, and that's it. Additionally, motors provide "<a href="https://en.wikipedia.org/wiki/Counter-electromotive_force" rel="nofollow noreferrer">back-EMF</a>": When opening (cutting power) an inductive load (e.g. a motor), the current wants to keep going. This will damage whatever just opened unless protection is used. So, I wouldn't be surprised if you damaged your Arduino by attempting to drive a motor with it.</p>

<p>So, what <em>can</em> you do? Use an H-Bridge. This circuit will allow you to easily control a motor &amp; its direction. Many circuits can be found online, but an easy solution is a cheap L298N module, which can be as cheap as $3 a piece. This will safely &amp; easily control the arm. Connecting your Arduino with the following circuit &amp; using your existing sketch will make it work.</p>



<p><img src="https://i.stack.imgur.com/WqFJG.png" alt="schematic"></p>



<p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fWqFJG.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p>
