diff --git a/SphereBot Arduino/SphereBot/StepperModel.cpp b/SphereBot Arduino/SphereBot/StepperModel.cpp index 69ff40e..bb7fdda 100644 --- a/SphereBot Arduino/SphereBot/StepperModel.cpp +++ b/SphereBot Arduino/SphereBot/StepperModel.cpp @@ -42,16 +42,18 @@ StepperModel::StepperModel(int inDirPin, int inStepPin, int inEnablePin, int inE pinMode(dirPin, OUTPUT); pinMode(stepPin, OUTPUT); pinMode(enablePin, OUTPUT); - pinMode(ms1Pin, OUTPUT); - pinMode(ms2Pin, OUTPUT); if(endStopPin>=0) - pinMode(endStopPin, INPUT); + pinMode(endStopPin, INPUT); + if((ms1Pin >=0) && (ms2Pin >=0)) + { + pinMode(ms1Pin, OUTPUT); + pinMode(ms2Pin, OUTPUT); + digitalWrite(ms1Pin, vms1); + digitalWrite(ms2Pin, vms2); + } digitalWrite(dirPin, LOW); digitalWrite(stepPin, LOW); - - digitalWrite(ms1Pin, vms1); - digitalWrite(ms2Pin, vms2); currentStepcount=0; targetStepcount=0; diff --git a/SphereBot Arduino/SphereBot/config.h b/SphereBot Arduino/SphereBot/config.h index 52a09d7..45e708a 100644 --- a/SphereBot Arduino/SphereBot/config.h +++ b/SphereBot Arduino/SphereBot/config.h @@ -2,6 +2,8 @@ * PINS */ + //ms1 and ms2 are optional. You can simply make these settings by hardwiring the pins to high or low + /* ms1 | ms2 ---------------- L | L -> Full Step @@ -18,16 +20,15 @@ #define YAXIS_DIR_PIN 14 #define YAXIS_STEP_PIN 15 #define YAXIS_ENABLE_PIN 21 -#define YAXIS_MS1_PIN 19 //don“t make this connection!! ADC6 and ADC7 can not be used as a digital pin ( I made the pull up connection manually) -#define YAXIS_MS2_PIN 28 -//#define YAXIS_MS3_PIN 18 +#define YAXIS_MS1_PIN -1 //ADC6 and ADC7 can not be used as a digital pin ( I made the pull up connection manually) +#define YAXIS_MS2_PIN -1 #define YAXIS_ENDSTOP_PIN -1 //13 #define XAXIS_DIR_PIN 10 #define XAXIS_STEP_PIN 8 #define XAXIS_ENABLE_PIN 2 -#define XAXIS_MS1_PIN 3 -#define XAXIS_MS2_PIN 4 +#define XAXIS_MS1_PIN -1 +#define XAXIS_MS2_PIN -1 #define XAXIS_ENDSTOP_PIN -1 // <0 0> No Endstop! #define SERVO_PIN 13 @@ -37,8 +38,8 @@ */ #define DEFAULT_PEN_UP_POSITION 35 -#define XAXIS_MIN_STEPCOUNT -5.6*230000 -#define XAXIS_MAX_STEPCOUNT 5*230000 +#define XAXIS_MIN_STEPCOUNT -5.6*230000 //max and min Values are not used by the firmware right now +#define XAXIS_MAX_STEPCOUNT 5*230000 // #define DEFAULT_ZOOM_FACTOR 0.1808 // With a Zoom-Faktor of .65, I can print gcode for Makerbot Unicorn without changes. // The zoom factor can be also manipulated by the propretiary code M402