summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortonokip <tonokip@gmail.com>2010-05-02 13:47:44 -0700
committertonokip <tonokip@gmail.com>2010-05-02 13:47:44 -0700
commit38eb0a1bcda7239f5c8b4f0158128a423b7f25d1 (patch)
treedba24f29735c8a06dbd61b0730ca8c97f40634e8
parent3d2194c3341e9e8b4b1068bfb3cd01fcef7b3f25 (diff)
added config option for inverting stepper direction
-rw-r--r--Tonokip_Firmware/Tonokip_Firmware.pde16
-rw-r--r--Tonokip_Firmware/configuration.h5
2 files changed, 13 insertions, 8 deletions
diff --git a/Tonokip_Firmware/Tonokip_Firmware.pde b/Tonokip_Firmware/Tonokip_Firmware.pde
index e5ee6af..4bb1ca0 100644
--- a/Tonokip_Firmware/Tonokip_Firmware.pde
+++ b/Tonokip_Firmware/Tonokip_Firmware.pde
@@ -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();
diff --git a/Tonokip_Firmware/configuration.h b/Tonokip_Firmware/configuration.h
index 50e1c76..268e05c 100644
--- a/Tonokip_Firmware/configuration.h
+++ b/Tonokip_Firmware/configuration.h
@@ -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.