added config option for inverting stepper direction
This commit is contained in:
parent
3d2194c334
commit
38eb0a1bcd
2 changed files with 13 additions and 8 deletions
|
|
@ -379,14 +379,14 @@ inline void get_coordinates()
|
|||
void linear_move(unsigned long x_steps_remaining, unsigned long y_steps_remaining, unsigned long z_steps_remaining, unsigned long e_steps_remaining) // make linear move with preset speeds and destinations, see G0 and G1
|
||||
{
|
||||
//Determine direction of movement
|
||||
if (destination_x > current_x) digitalWrite(X_DIR_PIN,HIGH);
|
||||
else digitalWrite(X_DIR_PIN,LOW);
|
||||
if (destination_y > current_y) digitalWrite(Y_DIR_PIN,HIGH);
|
||||
else digitalWrite(Y_DIR_PIN,LOW);
|
||||
if (destination_z > current_z) digitalWrite(Z_DIR_PIN,HIGH);
|
||||
else digitalWrite(Z_DIR_PIN,LOW);
|
||||
if (destination_e > current_e) digitalWrite(E_DIR_PIN,HIGH);
|
||||
else digitalWrite(E_DIR_PIN,LOW);
|
||||
if (destination_x > current_x) digitalWrite(X_DIR_PIN,!INVERT_X_DIR);
|
||||
else digitalWrite(X_DIR_PIN,INVERT_X_DIR);
|
||||
if (destination_y > current_y) digitalWrite(Y_DIR_PIN,!INVERT_Y_DIR);
|
||||
else digitalWrite(Y_DIR_PIN,INVERT_Y_DIR);
|
||||
if (destination_z > current_z) digitalWrite(Z_DIR_PIN,!INVERT_Z_DIR);
|
||||
else digitalWrite(Z_DIR_PIN,INVERT_Z_DIR);
|
||||
if (destination_e > current_e) digitalWrite(E_DIR_PIN,!INVERT_E_DIR);
|
||||
else digitalWrite(E_DIR_PIN,INVERT_E_DIR);
|
||||
|
||||
//Only enable axis that are moving. If the axis doesn't need to move then it can stay disabled depending on configuration.
|
||||
if(x_steps_remaining) enable_x();
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ const bool DISABLE_Y = false;
|
|||
const bool DISABLE_Z = true;
|
||||
const bool DISABLE_E = false;
|
||||
|
||||
const bool INVERT_X_DIR = false;
|
||||
const bool INVERT_Y_DIR = false;
|
||||
const bool INVERT_Z_DIR = false;
|
||||
const bool INVERT_E_DIR = false;
|
||||
|
||||
//Endstop Settings
|
||||
const bool ENDSTOPS_INVERTING = true;
|
||||
const bool min_software_endstops = false; //If true, axis won't move to coordinates less than zero.
|
||||
|
|
|
|||
Loading…
Reference in a new issue