Hello,
Really appreciate the interest and assistance you guys give someone new to electronics like me.
Couldn't find a DS for the stepper but the below link has a good detail of specs on the stepper - A longs 17HD4401N stepper.
http://edistri.be/eshop/index.php?route=product/product&product_id=58
I can't easily scan in a circuit diagram so have attached the simple fritzing one which is similar to my circuit. All wires are the same except the colours of the 4 stepper wires. They are red/blue and green/black, I have tested them with a multimeter.
The code I am using is as follows. I know it works because I have used it in other circuits. My original query which seems to have been a little lost judging from some of the replies is whether there are ay ways to diagnose problems with a stepper or stepper driver, perhaps by measuring current or voltage at certain points which might indicate the stepper is functioning or not. Anyway, any assistance is great. And thanks for the link to the stepper basics, they were good to read again but I have previously reviewed them.
/*
Test code using a stepper motor with a Pololu A4988 driver board or Sparkfun Big Easy Driver on an Arduino Uno using the on-board led which will flash with each step This code uses the delay() function to manage the timing.
Note must have Arduino pin 2 connected to the dir pin on driver
Note must have Arduino pin 3 connected to the step pin on driver
*/
byte directionPin = 2; // set dir pin to Arduino pin 2
byte stepPin = 3; // set step pin to Arduino pin 3
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20; // pulsewidth of 20 microseconds
int delaybetweenSteps = 25; // delay between steps of 25 ms
void setup()
{
digitalWrite(ledPin, LOW);
delay(2000);
pinMode(directionPin, OUTPUT);
pinMode(stepPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(directionPin, HIGH);
for(int x = 0; x < numberOfSteps; x++)
{
digitalWrite(stepPin, HIGH);
digitalWrite(stepPin, LOW);
delay(delaybetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
delay(1000); // delay of 1 second
digitalWrite(directionPin, LOW);
for(int x = 0; x < numberOfSteps; x++)
{
digitalWrite(stepPin, HIGH);
digitalWrite(stepPin, LOW);
delay(delaybetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
}
void loop() { }