summaryrefslogtreecommitdiff
path: root/Tonokip_Firmware
diff options
context:
space:
mode:
Diffstat (limited to 'Tonokip_Firmware')
-rw-r--r--Tonokip_Firmware/Tonokip_Firmware.pde94
-rw-r--r--Tonokip_Firmware/pins.h59
2 files changed, 101 insertions, 52 deletions
diff --git a/Tonokip_Firmware/Tonokip_Firmware.pde b/Tonokip_Firmware/Tonokip_Firmware.pde
index 1957cf9..cb8e552 100644
--- a/Tonokip_Firmware/Tonokip_Firmware.pde
+++ b/Tonokip_Firmware/Tonokip_Firmware.pde
@@ -475,59 +475,66 @@ inline void process_commands()
}
feedrate = 0;
-
- if((X_MIN_PIN > -1 && X_HOME_DIR==-1) || (X_MAX_PIN > -1 && X_HOME_DIR==1)) {
- current_position[0] = 0;
- destination[0] = 1.5 * X_MAX_LENGTH * X_HOME_DIR;
- feedrate = max_start_speed_units_per_second[0] * 60;
- prepare_move();
+ home_all_axis = !((code_seen(axis_codes[0])) || (code_seen(axis_codes[1])) || (code_seen(axis_codes[2])));
+
+ if((home_all_axis) || (code_seen('X'))) {
+ if((X_MIN_PIN > -1 && X_HOME_DIR==-1) || (X_MAX_PIN > -1 && X_HOME_DIR==1)) {
+ current_position[0] = 0;
+ destination[0] = 1.5 * X_MAX_LENGTH * X_HOME_DIR;
+ feedrate = max_start_speed_units_per_second[0] * 60;
+ prepare_move();
- current_position[0] = 0;
- destination[0] = -1 * X_HOME_DIR;
- prepare_move();
+ current_position[0] = 0;
+ destination[0] = -1 * X_HOME_DIR;
+ prepare_move();
- destination[0] = 10 * X_HOME_DIR;
- prepare_move();
+ destination[0] = 10 * X_HOME_DIR;
+ prepare_move();
- current_position[0] = 0;
- destination[0] = 0;
- feedrate = 0;
+ current_position[0] = 0;
+ destination[0] = 0;
+ feedrate = 0;
+ }
}
- if((Y_MIN_PIN > -1 && Y_HOME_DIR==-1) || (Y_MAX_PIN > -1 && Y_HOME_DIR==1)) {
- current_position[1] = 0;
- destination[1] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR;
- feedrate = max_start_speed_units_per_second[1] * 60;
- prepare_move();
+ if((home_all_axis) || (code_seen('X'))) {
+ if((Y_MIN_PIN > -1 && Y_HOME_DIR==-1) || (Y_MAX_PIN > -1 && Y_HOME_DIR==1)) {
+ current_position[1] = 0;
+ destination[1] = 1.5 * Y_MAX_LENGTH * Y_HOME_DIR;
+ feedrate = max_start_speed_units_per_second[1] * 60;
+ prepare_move();
- current_position[1] = 0;
- destination[1] = -1 * Y_HOME_DIR;
- prepare_move();
+ current_position[1] = 0;
+ destination[1] = -1 * Y_HOME_DIR;
+ prepare_move();
- destination[1] = 10 * Y_HOME_DIR;
- prepare_move();
+ destination[1] = 10 * Y_HOME_DIR;
+ prepare_move();
- current_position[1] = 0;
- destination[1] = 0;
- feedrate = 0;
+ current_position[1] = 0;
+ destination[1] = 0;
+ feedrate = 0;
+ }
}
- if((Z_MIN_PIN > -1 && Z_HOME_DIR==-1) || (Z_MAX_PIN > -1 && Z_HOME_DIR==1)) {
- current_position[2] = 0;
- destination[2] = 1.5 * Z_MAX_LENGTH * Z_HOME_DIR;
- feedrate = max_feedrate[2]/2;
- prepare_move();
+ if((home_all_axis) || (code_seen('X'))) {
+ if((Z_MIN_PIN > -1 && Z_HOME_DIR==-1) || (Z_MAX_PIN > -1 && Z_HOME_DIR==1)) {
+ current_position[2] = 0;
+ destination[2] = 1.5 * Z_MAX_LENGTH * Z_HOME_DIR;
+ feedrate = max_feedrate[2]/2;
+ prepare_move();
- current_position[2] = 0;
- destination[2] = -1 * Z_HOME_DIR;
- prepare_move();
+ current_position[2] = 0;
+ destination[2] = -1 * Z_HOME_DIR;
+ prepare_move();
- destination[2] = 10 * Z_HOME_DIR;
- prepare_move();
+ destination[2] = 10 * Z_HOME_DIR;
+ prepare_move();
- current_position[2] = 0;
- destination[2] = 0;
- feedrate = 0;
+ current_position[2] = 0;
+ destination[2] = 0;
+ feedrate = 0;
+ }
}
feedrate = saved_feedrate;
@@ -665,14 +672,13 @@ inline void process_commands()
bt = analog2tempBed(current_bed_raw);
#endif
#if (TEMP_0_PIN > -1) || defined (HEATER_USES_MAX6675)
- Serial.print("T:");
- Serial.println(tt);
- #if TEMP_1_PIN > -1
-
Serial.print("ok T:");
Serial.print(tt);
+ #if TEMP_1_PIN > -1
Serial.print(" B:");
Serial.println(bt);
+ #else
+ Serial.println();
#endif
#else
Serial.println("No thermistors - no temp");
diff --git a/Tonokip_Firmware/pins.h b/Tonokip_Firmware/pins.h
index 42845fd..9cdceb1 100644
--- a/Tonokip_Firmware/pins.h
+++ b/Tonokip_Firmware/pins.h
@@ -206,11 +206,55 @@
#endif
#endif
+// uncomment one of the following lines for RAMPS v1.3 or v1.0, comment both for v1.2 or 1.1
+// #define RAMPS_V_1_3
+// #define RAMPS_V_1_0
+
+
+#ifdef RAMPS_V_1_3
+
+#define X_STEP_PIN 54
+#define X_DIR_PIN 55
+#define X_ENABLE_PIN 38
+#define X_MIN_PIN 3
+#define X_MAX_PIN -1 //2 //Max endstops default to disabled "-1", set to commented value to enable.
+
+#define Y_STEP_PIN 60
+#define Y_DIR_PIN 61
+#define Y_ENABLE_PIN 56
+#define Y_MIN_PIN 14
+#define Y_MAX_PIN -1 //15
+
+#define Z_STEP_PIN 46
+#define Z_DIR_PIN 48
+#define Z_ENABLE_PIN 62
+#define Z_MIN_PIN 18
+#define Z_MAX_PIN -1 //19
+
+#define E_STEP_PIN 26
+#define E_DIR_PIN 28
+#define E_ENABLE_PIN 24
+
+#define SDPOWER -1
+#define SDSS 53
+#define LED_PIN 13
+#define FAN_PIN 9
+#define PS_ON_PIN 12
+#define KILL_PIN -1
+
+#define HEATER_0_PIN 10
+#define HEATER_1_PIN 8
+#define TEMP_0_PIN 13 // ANALOG NUMBERING
+#define TEMP_1_PIN 14 // ANALOG NUMBERING
+
+
+#else // RAMPS_V_1_1 or RAMPS_V_1_2 as default
+
#define X_STEP_PIN 26
#define X_DIR_PIN 28
#define X_ENABLE_PIN 24
#define X_MIN_PIN 3
-#define X_MAX_PIN -2 //2
+#define X_MAX_PIN -1 //2
#define Y_STEP_PIN 38
#define Y_DIR_PIN 40
@@ -231,28 +275,25 @@
#define SDPOWER 48
#define SDSS 53
#define LED_PIN 13
-
#define PS_ON_PIN -1
#define KILL_PIN -1
-// uncomment the following line for RAMPS V1.0
-// #define RAMPS_V_1_0
-#ifdef RAMPS_V_1_0
+
+#ifdef RAMPS_V_1_0 // RAMPS_V_1_0
#define HEATER_0_PIN 12 // RAMPS 1.0
#define HEATER_1_PIN -1 // RAMPS 1.0
-
#define FAN_PIN 11 // RAMPS 1.0
-#else // RAMPS_V_1_1 as default
+#else // RAMPS_V_1_1 or RAMPS_V_1_2
#define HEATER_0_PIN 10 // RAMPS 1.1
#define HEATER_1_PIN 8 // RAMPS 1.1
-
#define FAN_PIN 9 // RAMPS 1.1
#endif
#define TEMP_0_PIN 2 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
#define TEMP_1_PIN 1 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!!
+#endif
// SPI for Max6675 Thermocouple
@@ -409,6 +450,8 @@
#define TEMP_0_PIN 7 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 33 extruder)
#define TEMP_1_PIN 6 // MUST USE ANALOG INPUT NUMBERING NOT DIGITAL OUTPUT NUMBERING!!!!!!!!! (pin 34 bed)
+#define SDPOWER -1
+#define SDSS 31
#else