Hello everyone,
I am using MKS GEN 1.4 Board (Arduino Mega) along with DRV 8825 & NEMA17 Stepper motor for one of my project.
I need to Control 4 steppers with limit switch with simple stepper code or CNC Shield code, have selected this board as its has multiple feature on single board.
Issue: need to use this board without marline firmware and for the same i need PIN mapping, i have already done the google for and found some useful but still i am not getting for what i am looking for.
code sample.
define d_xDir 54
#define d_xStep 55
#define enable 38
//Total Steps to move
int stepDelay_swing = 60; //Delay between each pause
void setup() {
pinMode(d_xDir, OUTPUT);
pinMode(d_xStep,OUTPUT);
pinMode(enable,OUTPUT);
digitalWrite(enable, LOW);
}
void step_swing(boolean dir, byte dirPin, byte stepperPin, int steps)
{
digitalWrite(dirPin, dir);
for(int i = 0; i < steps; i++){
digitalWrite(stepperPin, HIGH);
delayMicroseconds(stepDelay_swing);
digitalWrite(stepperPin, LOW);
delayMicroseconds(stepDelay_swing);
}
}
void loop() {
step_swing(true,d_xDir,d_xStep,16000);
delayMicroseconds(stepDelay_swing);
step_swing(false,d_xDir,d_xStep,2000);
delay(2000);
}
pin_Ramps.h its showing 54, 55, 38, 53 for Stepper X, however when i tried to use the same PIN with this code i am not able to move, its just stall, by swapping pins its run but not with enough torque.
its seems like i am missing enable pin, need help please.