cd rom stepper motor and arduino

Here is I am shearing the code for drive a CD-Rom Stepper Motor. You can also watch the demo video.

To drive stepper motor I am using…

  • Arduino UNO
  • Adafruit driver shield (L293d driver shield)
  • CD Rom stepper motor

You have to connect the stepper motor to driver shield.

Here is the Arduino Code

#include <AFMotor.h>
// Motor with 200 steps per rev (1.8 degree)
// to motor port #1 (M1 and M2)
AF_Stepper motor(200, 2);
void setup() {
// set up Serial library at 9600 bps
Serial.begin(9600);
Serial.println("Stepper test!");
motor.setSpeed(4 00); // 50 rpm
}
void loop() {

Serial.println("Micrsostep steps");
motor.step(50, FORWARD, MICROSTEP);
motor.step(50, BACKWARD, MICROSTEP);
motor.step(100, FORWARD, MICROSTEP);
motor.step(100, BACKWARD, MICROSTEP);
motor.step(200, FORWARD, MICROSTEP);
motor.step(200, BACKWARD, MICROSTEP);
motor.step(250, FORWARD, MICROSTEP);
motor.step(250, BACKWARD, MICROSTEP);
delay(100);

motor.step(3, FORWARD, MICROSTEP);
motor.step(3, BACKWARD, MICROSTEP);
delay(1000);
}

18 Comments
  1. selim can Kavvas 6 years ago
    WordPress › Error

    There has been a critical error on this website.

    Learn more about troubleshooting WordPress.