DC Motor code and connect to Arduino

Hello, I have bought this motor https://www.pololu.com/product/3080/resources ,
and i dont know how to connect it to my arduino and the code for it, someone knows it and can help me?
thank you so much for your support.


Hi Carla, you’ll need a motor driver and an external power supply (e.g. battery).

The product page for your motor lists some recommended motor drivers. The DRV8835 shield for Arduino might be easiest because it can plug straight into an Arduino Uno. But you might be better off with one of the others if you have a different style of Arduino.

The article Arduino DC Motor Control Tutorial – L298N | PWM | H-Bridge gives a good introduction to controlling motors, in particular the “Arduino and L298N” section. Note that this article uses a 12V motor, but your motor appears to be rated for 6V, so be sure to choose your power supply accordingly. Also, the article uses the widely available L298N motor driver rather than a Pololu driver.