+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
+
+#define TEMP_SENSOR_0 1
+#define TEMP_SENSOR_1 0
+#define TEMP_SENSOR_2 0
+#define TEMP_SENSOR_BED 1
+
+// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
+//#define TEMP_SENSOR_1_AS_REDUNDANT
+#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
+
+// Actual temperature must be close to target for this long before M109 returns success
+//#define TEMP_RESIDENCY_TIME 10 // (seconds)
+#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one
+#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early.
+
+// The minimal temperature defines the temperature below which the heater will not be enabled It is used
+// to check that the wiring to the thermistor is not broken.
+// Otherwise this would lead to the heater being powered on all the time.
+#define HEATER_0_MINTEMP 5
+#define HEATER_1_MINTEMP 5
+#define HEATER_2_MINTEMP 5
+#define BED_MINTEMP 5
+
+// When temperature exceeds max temp, your heater will be switched off.
+// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
+// You should use MINTEMP for thermistor short/failure protection.
+#define HEATER_0_MAXTEMP 275
+#define HEATER_1_MAXTEMP 275
+#define HEATER_2_MAXTEMP 275
+#define BED_MAXTEMP 150
+
+// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
+// average current. The value should be an integer and the heat bed will be turned on for 1 interval of
+// HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
+//#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
+
+// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
+// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
+#define X_ENABLE_ON 0
+#define Y_ENABLE_ON 0
+#define Z_ENABLE_ON 0
+#define E_ENABLE_ON 0 // For all extruders
+
+// Disables axis when it's not being used.
+#define DISABLE_X false
+#define DISABLE_Y false
+#define DISABLE_Z false
+#define DISABLE_E false // For all extruders
+
+#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true
+#define INVERT_Y_DIR true // for Mendel set to true, for Orca set to false
+#define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true
+#define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
+#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
+#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
+
+// ENDSTOP SETTINGS:
+// Sets direction of endstops when homing; 1=MAX, -1=MIN
+#define X_HOME_DIR -1
+#define Y_HOME_DIR -1
+#define Z_HOME_DIR -1
+
+#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
+#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below.
+
+// Travel limits after homing
+#define X_MAX_POS 235
+#define X_MIN_POS 0
+#define Y_MAX_POS 235
+#define Y_MIN_POS 0
+#define Z_MAX_POS 260
+#define Z_MIN_POS 0
+
+#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
+#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
+#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
+//============================= Bed Auto Leveling ===========================
+
+//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
+
+#ifdef ENABLE_AUTO_BED_LEVELING
+
+ // these are the positions on the bed to do the probing
+ #define LEFT_PROBE_BED_POSITION 50
+ #define RIGHT_PROBE_BED_POSITION 180
+ #define BACK_PROBE_BED_POSITION 180
+ #define FRONT_PROBE_BED_POSITION 50
+
+ // these are the offsets to the prob relative to the extruder tip (Hotend - Probe)
+ #define X_PROBE_OFFSET_FROM_EXTRUDER -34
+ #define Y_PROBE_OFFSET_FROM_EXTRUDER 8
+ #define Z_PROBE_OFFSET_FROM_EXTRUDER -19.2
+
+ #define Z_RAISE_BEFORE_HOMING 18 // (in mm) Raise Z before homing (G28) for Probe Clearance.
+ // Be sure you have this distance over your Z_MAX_POS in case
+
+ #define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
+
+ #define Z_RAISE_BEFORE_PROBING 20 //How much the extruder will be raised before traveling to the first probing point.
+ #define Z_RAISE_BETWEEN_PROBINGS 10 //How much the extruder will be raised when traveling from between next probing points
+
+
+ //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
+ //The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
+ // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.
+
+ #define PROBE_SERVO_DEACTIVATION_DELAY 300
+
+
+//If you have enabled the Bed Auto Levelling and are using the same Z Probe for Z Homing,
+//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
+
+ #define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area.
+ // When defined, it will:
+ // - Allow Z homing only after X and Y homing AND stepper drivers still enabled
+ // - If stepper drivers timeout, it will need X and Y homing again before Z homing
+ // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
+ // - Block Z homing only when the probe is outside bed area.
+
+ #ifdef Z_SAFE_HOMING
+
+ #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2) // X point for Z homing when homing all axis (G28)
+ #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2) // Y point for Z homing when homing all axis (G28)
+
+ #endif
+
+ // with accurate bed leveling, the bed is sampled in a ACCURATE_BED_LEVELING_POINTSxACCURATE_BED_LEVELING_POINTS grid and least squares solution is calculated
+ // Note: this feature occupies 10'206 byte
+ #define ACCURATE_BED_LEVELING
+
+ #ifdef ACCURATE_BED_LEVELING
+ // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
+ #define ACCURATE_BED_LEVELING_POINTS 2
+ #endif
+
+#endif
+
+
+// The position of the homing switches
+//#define MANUAL_HOME_POSITIONS // If defined, MANUAL_*_HOME_POS below will be used
+//#define BED_CENTER_AT_0_0 // If defined, the center of the bed is at (X=0, Y=0)
+
+//Manual homing switch locations:
+// For deltabots this means top and center of the cartesian print volume.
+#define MANUAL_X_HOME_POS 0
+#define MANUAL_Y_HOME_POS 0
+#define MANUAL_Z_HOME_POS 0
+//#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
+
+//// MOVEMENT SETTINGS
+#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
+#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min)
+
+// default settings
+
+#define DEFAULT_AXIS_STEPS_PER_UNIT {80.000,80.000,400.000,93.00} // default steps per unit for Ultimaker
+#define DEFAULT_MAX_ACCELERATION {500,500,100,5000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
+
+#define DEFAULT_ACCELERATION 500 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
+#define DEFAULT_RETRACT_ACCELERATION 500 // X, Y, Z and E max acceleration in mm/s^2 for retracts
+
+// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
+// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
+// For the other hotends it is their distance from the extruder 0 hotend.
+// #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+// #define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+
+// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
+#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
+#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
+
+#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the filesystem block order.
+// if a file is deleted, it frees a block. hence, the order is not purely cronological. To still have auto0.g accessible, there is again the option to do that.
+// using:
+//#define MENU_ADDAUTOSTART
+
+// The hardware watchdog should reset the Microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+//#define USE_WATCHDOG
+
+#ifdef USE_WATCHDOG
+// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
+// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
+// However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
+//#define WATCHDOG_RESET_MANUAL
+#endif
+
+// Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled.
+//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
+
+// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
+// it can e.g. be used to change z-positions in the print startup phase in realtime
+// does not respect endstops!
+//#define BABYSTEPPING
+#ifdef BABYSTEPPING
+ #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions
+ #define BABYSTEP_INVERT_Z false //true for inverse movements in Z
+ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
+
+ #ifdef COREXY
+ #error BABYSTEPPING not implemented for COREXY yet.
+ #endif
+
+ #ifdef DELTA
+ #ifdef BABYSTEP_XY
+ #error BABYSTEPPING only implemented for Z axis on deltabots.
+ #endif
+ #endif
+#endif
+
+// extruder advance constant (s2/mm3)
+//
+// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTUDER_ADVANCE_K * cubic mm per second ^ 2
+//
+// hooke's law says: force = k * distance
+// bernoulli's priniciple says: v ^ 2 / 2 + g . h + pressure / density = constant
+// so: v ^ 2 is proportional to number of steps we advance the extruder
+extern int extrudemultiply; // Sets extrude multiply factor (in percent)
+extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
+ autostart_stilltocheck=true; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
+ //files auto[0-9].g on the sd card are performed in a row
+ //this is to delay autostart and hence the initialisaiton of the sd card to some seconds after the normal init, so the device is available quick after a reset
+ bool autostart_stilltocheck; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
+
+ LsAction lsAction; //stored for recursion.
+ int16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
+
+#define TEMP_SENSOR_0 -1
+#define TEMP_SENSOR_1 -1
+#define TEMP_SENSOR_2 0
+#define TEMP_SENSOR_BED 0
+
+// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
+//#define TEMP_SENSOR_1_AS_REDUNDANT
+#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
+
+// Actual temperature must be close to target for this long before M109 returns success
+#define TEMP_RESIDENCY_TIME 10 // (seconds)
+#define TEMP_HYSTERESIS 3 // (degC) range of +/- temperatures considered "close" to the target one
+#define TEMP_WINDOW 1 // (degC) Window around target to start the residency timer x degC early.
+
+// The minimal temperature defines the temperature below which the heater will not be enabled It is used
+// to check that the wiring to the thermistor is not broken.
+// Otherwise this would lead to the heater being powered on all the time.
+#define HEATER_0_MINTEMP 5
+#define HEATER_1_MINTEMP 5
+#define HEATER_2_MINTEMP 5
+#define BED_MINTEMP 5
+
+// When temperature exceeds max temp, your heater will be switched off.
+// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
+// You should use MINTEMP for thermistor short/failure protection.
+#define HEATER_0_MAXTEMP 275
+#define HEATER_1_MAXTEMP 275
+#define HEATER_2_MAXTEMP 275
+#define BED_MAXTEMP 150
+
+// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
+// average current. The value should be an integer and the heat bed will be turned on for 1 interval of
+// HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
+//#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
+
+// PID settings:
+// Comment the following line to disable PID and enable bang-bang.
+#define PIDTEMP
+#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
+#define PID_MAX 255 // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
+#ifdef PIDTEMP
+ //#define PID_DEBUG // Sends debug data to the serial port.
+ //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
+ #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
+ // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
+ #define PID_INTEGRAL_DRIVE_MAX 255 //limit for the integral term
+ #define K1 0.95 //smoothing factor within the PID
+ #define PID_dT ((16.0 * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine
+
+// If you are using a preconfigured hotend then you can use one of the value sets by uncommenting it
+// Ultimaker
+ #define DEFAULT_Kp 22.2
+ #define DEFAULT_Ki 1.08
+ #define DEFAULT_Kd 114
+
+// Makergear
+// #define DEFAULT_Kp 7.0
+// #define DEFAULT_Ki 0.1
+// #define DEFAULT_Kd 12
+
+// Mendel Parts V9 on 12V
+// #define DEFAULT_Kp 63.0
+// #define DEFAULT_Ki 2.25
+// #define DEFAULT_Kd 440
+#endif // PIDTEMP
+
+// Bed Temperature Control
+// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
+//
+// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder.
+// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz,
+// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
+// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
+// If your configuration is significantly different than this and you don't understand the issues involved, you probably
+// shouldn't use bed PID until someone else verifies your hardware works.
+// If this is enabled, find your own PID constants below.
+//#define PIDTEMPBED
+//
+//#define BED_LIMIT_SWITCHING
+
+// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
+// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
+// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
+// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
+#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
+
+#ifdef PIDTEMPBED
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
+//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
+ #define DEFAULT_bedKp 10.00
+ #define DEFAULT_bedKi .023
+ #define DEFAULT_bedKd 305.4
+
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
+//from pidautotune
+// #define DEFAULT_bedKp 97.1
+// #define DEFAULT_bedKi 1.41
+// #define DEFAULT_bedKd 1675.16
+
+// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
+#endif // PIDTEMPBED
+
+
+
+//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
+//can be software-disabled for whatever purposes by
+#define PREVENT_DANGEROUS_EXTRUDE
+//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
+#define PREVENT_LENGTHY_EXTRUDE
+
+#define EXTRUDE_MINTEMP 170
+#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
+#define DEFAULT_MAX_ACCELERATION {9000,9000,9000,10000} // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
+
+#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
+#define DEFAULT_RETRACT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for retracts
+
+// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
+// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
+// For the other hotends it is their distance from the extruder 0 hotend.
+// #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
+// #define EXTRUDER_OFFSET_Y {0.0, 5.00} // (in mm) for each extruder, offset of the hotend on the Y axis
+
+// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
+#define DEFAULT_XYJERK 20.0 // (mm/sec)
+#define DEFAULT_ZJERK 20.0 // (mm/sec) Must be same as XY for delta
+#define SD_FINISHED_STEPPERRELEASE true //if sd support and the file is finished: disable steppers?
+#define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
+
+#define SDCARD_RATHERRECENTFIRST //reverse file order of sd card menu display. Its sorted practically after the filesystem block order.
+// if a file is deleted, it frees a block. hence, the order is not purely cronological. To still have auto0.g accessible, there is again the option to do that.
+// using:
+//#define MENU_ADDAUTOSTART
+
+// The hardware watchdog should reset the Microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
+//#define USE_WATCHDOG
+
+#ifdef USE_WATCHDOG
+// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
+// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
+// However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
+//#define WATCHDOG_RESET_MANUAL
+#endif
+
+// Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled.
+//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
+
+// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
+// it can e.g. be used to change z-positions in the print startup phase in realtime
+// does not respect endstops!
+//#define BABYSTEPPING
+#ifdef BABYSTEPPING
+ #define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions
+ #define BABYSTEP_INVERT_Z false //true for inverse movements in Z
+ #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
+
+ #ifdef COREXY
+ #error BABYSTEPPING not implemented for COREXY yet.
+ #endif
+
+ #ifdef DELTA
+ #ifdef BABYSTEP_XY
+ #error BABYSTEPPING only implemented for Z axis on deltabots.
+ #endif
+ #endif
+#endif
+
+// extruder advance constant (s2/mm3)
+//
+// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTUDER_ADVANCE_K * cubic mm per second ^ 2
+//
+// hooke's law says: force = k * distance
+// bernoulli's priniciple says: v ^ 2 / 2 + g . h + pressure / density = constant
+// so: v ^ 2 is proportional to number of steps we advance the extruder
+// Initialize and start the stepper motor subsystem
+void st_init();
+
+// Block until all buffered steps are executed
+void st_synchronize();
+
+// Set current position in steps
+void st_set_position(const long &x, const long &y, const long &z, const long &e);
+void st_set_e_position(const long &e);
+
+// Get current position in steps
+long st_get_position(uint8_t axis);
+
+#ifdef ENABLE_AUTO_BED_LEVELING
+// Get current position in mm
+float st_get_position_mm(uint8_t axis);
+#endif //ENABLE_AUTO_BED_LEVELING
+
+// The stepper subsystem goes to sleep when it runs out of things to execute. Call this
+// to notify the subsystem that it is time to go to work.
+void st_wake_up();
+
+
+void checkHitEndstops(); //call from somwhere to create an serial error message with the locations the endstops where hit, in case they were triggered
+void endstops_hit_on_purpose(); //avoid creation of the message, i.e. after homeing and before a routine call of checkHitEndstops();
+/* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
+static void lcd_printPGM(const char* str)
+{
+ char c;
+ while((c = pgm_read_byte(str++)) != '\0')
+ {
+ lcd.write(c);
+ }
+}
+/*
+Possible status screens:
+16x2 |0123456789012345|
+ |000/000 B000/000|
+ |Status line.....|
+
+16x4 |0123456789012345|
+ |000/000 B000/000|
+ |SD100% Z000.0|
+ |F100% T--:--|
+ |Status line.....|
+
+20x2 |01234567890123456789|
+ |T000/000D B000/000D |
+ |Status line.........|
+
+20x4 |01234567890123456789|
+ |T000/000D B000/000D |
+ |X+000.0 Y+000.0 Z+000.0|
+ |F100% SD100% T--:--|
+ |Status line.........|
+
+20x4 |01234567890123456789|
+ |T000/000D B000/000D |
+ |T000/000D Z000.0|
+ |F100% SD100% T--:--|
+ |Status line.........|
+*/
+static void lcd_implementation_status_screen()
+{
+ int tHotend=int(degHotend(0) + 0.5);
+ int tTarget=int(degTargetHotend(0) + 0.5);
+
+#if LCD_WIDTH < 20
+ lcd.setCursor(0, 0);
+ lcd.print(itostr3(tHotend));
+ lcd.print('/');
+ lcd.print(itostr3left(tTarget));
+
+# if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
+ //If we have an 2nd extruder or heated bed, show that in the top right corner
+ lcd.setCursor(8, 0);
+# if EXTRUDERS > 1
+ tHotend = int(degHotend(1) + 0.5);
+ tTarget = int(degTargetHotend(1) + 0.5);
+ lcd.print(LCD_STR_THERMOMETER[0]);
+# else//Heated bed
+ tHotend=int(degBed() + 0.5);
+ tTarget=int(degTargetBed() + 0.5);
+ lcd.print(LCD_STR_BEDTEMP[0]);
+# endif
+ lcd.print(itostr3(tHotend));
+ lcd.print('/');
+ lcd.print(itostr3left(tTarget));
+# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
+
+#else//LCD_WIDTH > 19
+ lcd.setCursor(0, 0);
+ lcd.print(LCD_STR_THERMOMETER[0]);
+ lcd.print(itostr3(tHotend));
+ lcd.print('/');
+ lcd.print(itostr3left(tTarget));
+ lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
+ if (tTarget < 10)
+ lcd.print(' ');
+
+# if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
+ //If we have an 2nd extruder or heated bed, show that in the top right corner
+ lcd.setCursor(10, 0);
+# if EXTRUDERS > 1
+ tHotend = int(degHotend(1) + 0.5);
+ tTarget = int(degTargetHotend(1) + 0.5);
+ lcd.print(LCD_STR_THERMOMETER[0]);
+# else//Heated bed
+ tHotend=int(degBed() + 0.5);
+ tTarget=int(degTargetBed() + 0.5);
+ lcd.print(LCD_STR_BEDTEMP[0]);
+# endif
+ lcd.print(itostr3(tHotend));
+ lcd.print('/');
+ lcd.print(itostr3left(tTarget));
+ lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
+ if (tTarget < 10)
+ lcd.print(' ');
+# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
+#endif//LCD_WIDTH > 19
+
+#if LCD_HEIGHT > 2
+//Lines 2 for 4 line LCD
+# if LCD_WIDTH < 20
+# ifdef SDSUPPORT
+ lcd.setCursor(0, 2);
+ lcd_printPGM(PSTR("SD"));
+ if (IS_SD_PRINTING)
+ lcd.print(itostr3(card.percentDone()));
+ else
+ lcd_printPGM(PSTR("---"));
+ lcd.print('%');
+# endif//SDSUPPORT
+# else//LCD_WIDTH > 19
+# if EXTRUDERS > 1 && TEMP_SENSOR_BED != 0
+ //If we both have a 2nd extruder and a heated bed, show the heated bed temp on the 2nd line on the left, as the first line is filled with extruder temps
+ tHotend=int(degBed() + 0.5);
+ tTarget=int(degTargetBed() + 0.5);
+
+ lcd.setCursor(0, 1);
+ lcd.print(LCD_STR_BEDTEMP[0]);
+ lcd.print(itostr3(tHotend));
+ lcd.print('/');
+ lcd.print(itostr3left(tTarget));
+ lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
+ if (tTarget < 10)
+ lcd.print(' ');
+# else
+ lcd.setCursor(0,1);
+ lcd.print('X');
+ lcd.print(ftostr3(current_position[X_AXIS]));
+ lcd_printPGM(PSTR(" Y"));
+ lcd.print(ftostr3(current_position[Y_AXIS]));
+# endif//EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
+# endif//LCD_WIDTH > 19
+ lcd.setCursor(LCD_WIDTH - 8, 1);
+ lcd.print('Z');
+ lcd.print(ftostr32(current_position[Z_AXIS]));
+#endif//LCD_HEIGHT > 2
+
+#if LCD_HEIGHT > 3
+ lcd.setCursor(0, 2);
+ lcd.print(LCD_STR_FEEDRATE[0]);
+ lcd.print(itostr3(feedmultiply));
+ lcd.print('%');
+# if LCD_WIDTH > 19
+# ifdef SDSUPPORT
+ lcd.setCursor(7, 2);
+ lcd_printPGM(PSTR("SD"));
+ if (IS_SD_PRINTING)
+ lcd.print(itostr3(card.percentDone()));
+ else
+ lcd_printPGM(PSTR("---"));
+ lcd.print('%');
+# endif//SDSUPPORT
+# endif//LCD_WIDTH > 19
+ lcd.setCursor(LCD_WIDTH - 6, 2);
+ lcd.print(LCD_STR_CLOCK[0]);
+ if(starttime != 0)
+ {
+ uint16_t time = millis()/60000 - starttime/60000;