Hi!
Well the title speaks for itself. Does this indicate a normal mistake?
Im using a Nema 17 stepper motor (1.7A) with a EasyDriver and 9V battery supply
I use this layout:
And this code:
#include <Stepper.h>
int oneway; // counter for steps
int onerev = 6400; // number of steps each direction (edit this
// for your particular motor)
int microSecDelay = 30; // delay between steps and speed of the motor
// (about as fast as the system can react,
// higher number = slower)
int dirPin = 8; // output pin for stepper motor direction
int stepPin = 9; // output pin for the pin used to step the motor
void setup() {
pinMode(dirPin, OUTPUT); // Assign output mode to pin for direction
pinMode(stepPin, OUTPUT); // Assign output mode to pin for setp
digitalWrite(dirPin, LOW); // Initialize dir pin
digitalWrite(stepPin, LOW); // Initialize step pin
oneway = 1;
}
void loop() {
if (oneway < onerev + 1) // Still in first revolution?
{
digitalWrite(dirPin, LOW); // Keep direction pin low
}
else
{
digitalWrite(dirPin, HIGH); // If not in first revolution change
// direction pin to High
}
digitalWrite(stepPin, HIGH); // Step motor
delayMicroseconds(microSecDelay); // Wait microseconds
digitalWrite(stepPin, LOW); // Step motor
delayMicroseconds(microSecDelay); // Wait microseconds
oneway += 1; // Increment direction counter
if (oneway > onerev * 2) // If we have exceeded two revolutions
{ oneway = 1; } // Reset counter to start over again
} // EOF
Ive used a multimeter and found that the first cable(from left) and third gets 7V, and the other two a few mV. Should it be like that?
I know I should use a Big easy driver or something similar, I've already ordered one, but shouldn't it still be able to turn?
Ive followed this tutorial: http://www.instructables.com/id/Stepper-Motor-Easy-Driver/?ALLSTEPS
-Thanks for any replies!
