Arduino digitalWrite not working
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 &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.







simulate this circuit &ndash; Schematic created using CircuitLab