Hi murf83,
I don't have any actual code to share, but have a few things for you to check:
- You set the enable pin LOW. Verify that LOW enables the motor.
- You loop 3230 times for 1 rotation. In that loop all you do is set the DIR pin to high. It is never set LOW. Also, should you pulse the STEP pin instead?
- When you do pulse the STEP pin (after the if statement), you don't give the pulse a duration.
This is what I would expect (Caveat - I have not compiled this or tested it. The real details depend on your specific motor.):
#define STEP_PIN 54
#define DIR_PIN 55
#define ENABLE_PIN 38
const int ROTATION = 3230; // pulses in 1 rotation
const int PULSEWIDTH = xxx; // each pulse is xxx ms long
const int BETWEEN = xxx; // ms between pulses
void setup() {
pinMode(STEP_PIN, OUTPUT);
pinMode(DIR_PIN, OUTPUT);
pinMode(ENABLE_PIN, OUTPUT);
digitalWrite(ENABLE_PIN, LOW); // low = enable motor control
digitalWrite(DIR_PIN, HIGH); // high = direction xxx
}
void loop(){
for (int pulseCnt=0; pulseCnt<ROTATION; pulseCnt++)
{
digitalWrite(STEP_PIN , HIGH);
delay(PULSEWIDTH);
digitalWrite(STEP_PIN , LOW);
delay(BETWEEN);
}
}