We are hosting Hackster Cafe: Open Hardware Summit. Watch the stream live on Friday!We are hosting Hackster Cafe: Open Hardware Summit. Stream on Friday!
hIOTron
Created February 3, 2020 © GPL3+

Interfacing Stepper Motor with Arduino Uno

The project is about how to interface Stepper Motor with Arduino Uno.

Interfacing Stepper Motor with Arduino Uno

Things used in this project

Story

Read more

Code

Run a program

Arduino
// Arduino stepper motor control code

#include <Stepper.h> // Include the header file

// change this to the number of steps on your motor
#define STEPS 32

// create an instance of the stepper class using the steps and pins
Stepper stepper(STEPS, 8, 10, 9, 11);

int val = 0;

void setup() {
  Serial.begin(9600);
  stepper.setSpeed(200);
}

void loop() {

  if (Serial.available()>0)
  {
    val = Serial.parseInt();
    stepper.step(val);
    Serial.println(val); //for debugging
  }
 

}

Credits

hIOTron
78 projects • 2 followers
hIOTron is an internet of things based company that offers an IoT Platform, products, IoT Solutions, and IoT Training.
Contact

Comments

Please log in or sign up to comment.