I haven't seen one of those in a LONG-LONG time! It technically does have a DIR pin (tied to one of the step pins with a pull-up resistor). Its a Uni-Polar driver ** IF ** I recall correctly.
Sure, you can work with that.
Here's a (modified) non-blocking function I use to drive the steppers for my CNC project.
You can call it as often as you like, from your loop() routine. It does not block, and it uses the digitalFastWrite library for an 8x speed boost.
#include <digitalWriteFast.h> // http://code.google.com/p/digitalwritefast/
#define stepPin1a 2
#define stepPin1b 3
#define stepPin2a 4
#define stepPin2b 5 // Add more as needed.
int minStepTime=25; //delay in microSeconds between step pulses. lower=faster.
boolean stepState=LOW;
unsigned long stepTimeOld=0;
long stepper1Pos=0;
long stepper2Pos=0;
long stepper1Goto=0;
long stepper2Goto=0;
void stepLight()
{
unsigned long curTime=micros();
if(curTime - stepTimeOld >= (minStepTime/2))
{
stepState=!stepState;
// Add more as needed here as well. (Must match #define section.)
if(stepper1Pos > stepper1Goto) digitalWriteFast2(stepPin1a,stepState);stepper1Pos--;
if(stepper1Pos < stepper1Goto) digitalWriteFast2(stepPin1b,stepState);stepper1Pos++;
if(stepper2Pos > stepper2Goto) digitalWriteFast2(stepPin2a,stepState);stepper2Pos--;
if(stepper2Pos < stepper2Goto) digitalWriteFast2(stepPin2b,stepState);stepper2Pos++;
stepTimeOld=curTime;
}
}
// call from loop routine like this:
void loop()
{
stepper1Goto=12345; // update as often as you like.
stepper2Goto=67890;
stepLight();
}
That should do what you want, add 8 more entries top and bottom and you'll have all 6 steppers looking for thier long lost arm in no time at all. If this rusty old mechanic's memory serves me right. That should handle about 24v@5 amps per coil (WITH FAN) [120 watts total]. Nice score on the salvage btw! ![]()