-
1Run a Program
// Arduino stepper motor control code
#include // 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
}
}
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.