From 38eb0a1bcda7239f5c8b4f0158128a423b7f25d1 Mon Sep 17 00:00:00 2001 From: tonokip Date: Sun, 2 May 2010 13:47:44 -0700 Subject: added config option for inverting stepper direction --- Tonokip_Firmware/Tonokip_Firmware.pde | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Tonokip_Firmware/Tonokip_Firmware.pde') 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(); -- cgit v1.2.1