

ARDUINO STEPPER MOTOR LIBRARY CODE
This is the most basic code needed to run the motor and is presented as an entry level just to get the motor up and running. I will present three different code snippets that goes from “super basic” to a more optimised one: The 101 Once the hardware is hooked up correctly, open your Arduino IDE and copy/paste one of the following code snippets to see the magic happen.

! The stepper motor will behave odd with only USB power, so remember to hook up your Arduino with an external 12v power supply. It will be explained further down in the article. ! The cable from ENABLE (on the EasyDriver) to PIN 7 (on the Arduino) is not required but recommended. Hook the hardware up like this: The wiretable for Arduino EasyDriver Stepper motor tutorial This makes the stepper motor perfect for applications where you have to move something precisely, and to know the position. (Each step is then divided into minor micro steps, so in reality it needs more micro steps to turn 360 degrees. For example the motor I am using in this tutorial moves 1.8 degrees per step, this equals to 200 steps for a 360 degrees rotation. Since the motor moves precisely x amount of degrees per step, you can easily control just how much it is going to move, and easily count how much it has moved. The steps are measured in degrees and vary from motor to motor. What you need to get started What is a stepper motor and why should you care?Ī stepper motor is an electrical motor that turn in steps, this is in contrast to a conventional motor that moves smoothly. Stepper motor (I used this one, but you can use whichever you want).Arduino Uno (it can be another controller, but for this tutorial I use the Uno).Great, it’s super easy and I will show you how. So, you want to step it up a notch and create an awesome project using a stepper motor?
