Advertisement
juanyunis

LCD Configuration.h

Mar 27th, 2020
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 12.24 KB | None | 0 0
  1. #ifndef _CONFIGRATION_H_
  2. #define _CONFIGRATION_H_
  3.  
  4. //===========================================================================
  5. //============================= General Settings ============================
  6. //===========================================================================
  7.  
  8. /**
  9.  * Default Mode
  10.  *
  11.  * Mode switching is still possible by by holding down the encorder for two seconds.
  12.  *
  13.  * Options:
  14.  * ST7920_SPI // Marlin Mode
  15.  * SERIAL_TSC // Touch Mode
  16.  */
  17. #define DEFAULT_LCD_MODE SERIAL_TSC
  18.  
  19. /**
  20.  * Default Startup Knob LED Color (TFT35 E3)
  21.  *
  22.  * Options:  1: LED_OFF,     2: LED_WHITE,   3: LED_RED,
  23.  *           4: LED_ORANGE,  5: LED_YELLOW,  6: LED_GREEN,
  24.  *           7: LED_BLUE,    8: LED_INDIGO,  9: LED_VIOLET
  25.  *
  26.  * Default value is: 1 for LED_OFF
  27. */
  28. #define STARTUP_KNOB_LED_COLOR 2         // LED_OFF
  29. #define KEEP_KNOB_LED_COLOR_MARLIN_MODE  // Keeps the LED state in Marlin Mode
  30.  
  31. /**
  32.  * Default LCD Brightness
  33.  *
  34.  * Options:  LCD_5_PERCENT, LCD_10_PERCENT, LCD_20_PERCENT,
  35.  *           LCD_30_PERCENT, LCD_40_PERCENT, LCD_50_PERCENT,
  36.  *           LCD_60_PERCENT, LCD_70_PERCENT, LCD_80_PERCENT,
  37.  *           LCD_90_PERCENT, LCD_100_PERCENT
  38.  */
  39. #ifdef LCD_LED_PIN
  40.   #define DEFAULT_LCD_BRIGHTNESS LCD_100_PERCENT
  41. #endif
  42.  
  43. //===========================================================================
  44. //=========================== Marlin Mode Settings ==========================
  45. //===========================================================================
  46.  
  47. /**
  48.  * Default Marlin Mode Background & Font Color Options
  49.  *
  50.  * These colors can be changed in Touch mode, but can also be set here.
  51.  *
  52.  * Options: BLACK, BLUE, BROWN, BRRED, CYAN, GBLUE, GRAY, GREEN, MAGENTA, RED, WHITE, YELLOW
  53.  */
  54. #define ST7920_BKCOLOR BLACK
  55. #define ST7920_FNCOLOR GREEN
  56.  
  57. /**
  58.  *  Text displayed at the top of the TFT in Marlin Mode.
  59.  */
  60. //#define ST7920_BANNER_TEXT "LCD12864 Simulator"
  61.  
  62. /**
  63.  * Run Marlin Mode Fullscreen
  64.  *
  65.  *  *** NOT RECOMMENDED FOR TFT24 ***
  66.  */
  67. #define ST7920_FULLSCREEN
  68.  
  69. /**
  70.  * Clean Mode Switching Support
  71.  *
  72.  * Keep UART (Serial communication) alive in Marlin Mode
  73.  *
  74.  * Allow seamless OctoPrint UART connection to the TFT's UART/serial expansion port no matter which mode the TFT is in.
  75.  *
  76.  * *** ONLY SUPPORTED ON TFT24 V1.1, TFT35 V3.0, AND TFT28 V3.0 ***
  77.  */
  78. #define CLEAN_MODE_SWITCHING_SUPPORT  // Enable CLEAN MODE SWITCHING SUPPORT
  79.  
  80. //===========================================================================
  81. //========================== Touch Mode Settings ============================
  82. //===========================================================================
  83.  
  84. /**
  85.  * This setting determines the communication speed of the printer.
  86.  *
  87.  * 250000 works in most cases, but you might try a lower speed if
  88.  * you commonly experience drop-outs during host printing.
  89.  * You may try up to 1000000 to speed up SD file transfer.
  90.  *
  91.  * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000]
  92.  */
  93. #define BAUDRATE 250000
  94.  
  95. /**
  96.  * Default Touch Mode Language
  97.  *
  98.  * Select the language to display on the LCD while in Touch Mode.
  99.  *
  100.  * Options: ARMENIAN, CHINESE, CZECH, DUTCH, ENGLISH, FRENCH, GERMAN, HUNGARY, ITALIAN, JAPANESE, POLISH, PORTUGUESE, RUSSIAN, SLOVAK, SPAIN
  101.  */
  102. #define DEFAULT_LANGUAGE ENGLISH
  103.  
  104. /**
  105.  *  Show bootscreen when starting up
  106.  */
  107. #define SHOW_BTT_BOOTSCREEN
  108.  
  109. /**
  110.  * The duration and frequency for the UI feedback sound.
  111.  * Set these to 0 to disable audio feedback in the LCD menus.
  112.  * Only valid for SERIAL_TSC LCD MODE and if BUZZER_PIN is set or available.
  113.  *
  114.  * Note: Test audio output with the G-Code:
  115.  * M300 S<frequency Hz> P<duration ms>
  116.  */
  117. #define BUZZER_FREQUENCY_DURATION_MS 20 // Default 20
  118. #define BUZZER_FREQUENCY_HZ 10000       // Default 10000, 20Hz to 60KHz
  119. #define BUZZER_STOP_LEVEL false
  120.  
  121. /**
  122.  * Default Touch Mode Color Options
  123.  */
  124. #define TITLE_BACKGROUND_COLOR      BLACK  // Title background color // 0xD928
  125. #define BACKGROUND_COLOR            BLACK  // Background color // 0x0A29
  126. #define FONT_COLOR                  WHITE  // Font foreground color
  127. #define REMINDER_FONT_COLOR         RED    // Reminder font color, such as: "No print attached", "Busy processing", etc.
  128. #define VOLUME_REMINDER_FONT_COLOR  GBLUE  // Volume reminder font color, such as: "Card inserted", "Card removed"
  129.  
  130. #define TOOL_NUM     1    // set in 1~6
  131. #define EXTRUDER_NUM 1    // set in 1~6
  132. #define FAN_NUM      1    // set in 1~6
  133.  
  134. //                       PLA      PETG       ABS
  135. #define PREHEAT_BED      {65,      100,       110}
  136. #define PREHEAT_HOTEND   {140,     160,      200}
  137.  
  138. #define HEAT_MAX_TEMP    {130,    275,       275,       275,       275,       275,       275}    //max temperature can be set
  139. #define HEAT_SIGN_ID     {"B:",   "T0:",     "T1:",     "T2:",     "T3:",     "T4:",     "T5:"}
  140. #define HEAT_DISPLAY_ID  {"Bed",  "T0",      "T1",      "T2",      "T3",      "T4",      "T5"}
  141. #define HEAT_CMD         {"M140", "M104 T0", "M104 T1", "M104 T2", "M104 T3", "M104 T4", "M104 T5" };
  142. #define HEAT_WAIT_CMD    {"M190", "M109 T0", "M109 T1", "M109 T2", "M109 T3", "M109 T4", "M109 T5" };
  143.  
  144. #define TOOL_CHANGE      {"T0",   "T1",      "T2",      "T3",      "T4",      "T5"}
  145. #define EXTRUDER_ID      {"E0",   "E1",      "E2",      "E3",      "E4",      "E5"}
  146.  
  147. #define FAN_MAX_PWM      {255,       255,       255,       255,       255,       255}
  148. #define FAN_ID           {"F0",    "F1",    "F2",    "F3",    "F4",    "F5"}
  149. #define FAN_CMD          {"M106 P0", "M106 P1", "M106 P2", "M106 P3", "M106 P4", "M106 P5" };
  150.  
  151. #define SPEED_ID         {"Sp.", "Fr."}
  152.  
  153. // Default move speed mm/min
  154. #define DEFAULT_SPEED_MOVE      3000
  155. #define SPEED_MOVE_SLOW         1000
  156. #define SPEED_MOVE_FAST         5000
  157.  
  158. // Extrude speed mm/min
  159. #define EXTRUDE_SLOW_SPEED      60
  160. #define EXTRUDE_NORMAL_SPEED    600
  161. #define EXTRUDE_FAST_SPEED      1200
  162.  
  163. // Size of machine
  164. #define X_MIN_POS 0
  165. #define Y_MIN_POS 0
  166. #define Z_MIN_POS 0
  167. #define X_MAX_POS 235
  168. #define Y_MAX_POS 236
  169. #define Z_MAX_POS 240
  170.  
  171. // Specify a pause position as { X, Y, Z_raise }
  172. #define NOZZLE_PAUSE_RETRACT_LENGTH 15   // (mm)
  173. #define NOZZLE_RESUME_PURGE_LENGTH  16   // (mm)
  174. #define NOZZLE_PAUSE_X_POSITION     (X_MIN_POS + 10)  // (mm) Must be an integer
  175. #define NOZZLE_PAUSE_Y_POSITION     (Y_MIN_POS + 10)  // (mm) Must be an integer
  176. #define NOZZLE_PAUSE_Z_RAISE        20   // (mm)
  177. #define NOZZLE_PAUSE_E_FEEDRATE     6000 // (mm/min) retract & purge feedrate
  178. #define NOZZLE_PAUSE_XY_FEEDRATE    6000 // (mm/min) X and Y axes feedrate
  179. #define NOZZLE_PAUSE_Z_FEEDRATE     600  // (mm/min) Z axis feedrate
  180.  
  181. /**
  182.  * Auto Save Load Leveling Data
  183.  * The TFT will auto detect if Auto Bed Level is available.
  184.  * Enable this will send "M500" after "G29" to store leveling value
  185.  * and send "M420 S1" to enable leveling state after startup
  186.  */
  187. #define AUTO_SAVE_LOAD_LEVELING_VALUE
  188.  
  189. /**
  190.  * Manual Leveling
  191.  * Move to four corner points to Leveling manually (Point 1, Point 2, Point 3, Point 4)
  192.  */
  193. #define LEVELING_POINT_1_X         (X_MIN_POS + 20)
  194. #define LEVELING_POINT_1_Y         (Y_MIN_POS + 20)
  195. #define LEVELING_POINT_2_X         (X_MAX_POS - 20)
  196. #define LEVELING_POINT_2_Y         (Y_MIN_POS + 20)
  197. #define LEVELING_POINT_3_X         (X_MAX_POS - 20)
  198. #define LEVELING_POINT_3_Y         (Y_MAX_POS - 20)
  199. #define LEVELING_POINT_4_X         (X_MIN_POS + 20)
  200. #define LEVELING_POINT_4_Y         (Y_MAX_POS - 20)
  201. #define LEVELING_POINT_Z           0.2f  // Z-axis position when nozzle stays for leveling
  202. #define LEVELING_POINT_MOVE_Z      10.0f // Z-axis position when nozzle move to next point
  203. #define LEVELING_POINT_XY_FEEDRATE 6000  // (mm/min) X and Y axes move feedrate
  204. #define LEVELING_POINT_Z_FEEDRATE  600   // (mm/min) Z axis move feedrate
  205.  
  206. // Power Supply
  207. #define PS_ON_ACTIVE_HIGH    true   // Set 'false' for ATX (1), 'true' for X-Box (2)
  208.  
  209. // Filament runout detection
  210. #define FIL_RUNOUT_INVERTING true  // Set to false to invert the logic of the sensor.
  211. #define FIL_NOISE_THRESHOLD  100   // 100ms,  Pause print when filament runout is detected for 100ms.
  212.  
  213. // Smart filament runout detection
  214. // For use with an encoder disc that toggles runout pin as filament moves
  215. #define FILAMENT_RUNOUT_DISTANCE_MM 7
  216.  
  217. // Enable alternative Move Menu Buttons Layout matching the direction of actual printer axis.
  218. // update the icons from alternate icon folder
  219. #define ALTERNATIVE_MOVE_MENU
  220.  
  221. // Enable Unified Move Menu
  222. // Move, Home, Extrude, ABL at one Place and bring G-code Menu on Home Menu
  223. #define UNIFIED_MENU
  224.  
  225. /**
  226.  * SD support
  227.  * The TFT will auto configure M27 AutoReport with M115 command
  228.  * Set the time interval to poll SD Printing status if Marlin reports M27 disabled.
  229.  */
  230. #define ONBOARD_SD_SUPPORT
  231. #ifdef ONBOARD_SD_SUPPORT
  232.   #define M27_REFRESH                3        // Time in sec for M27 command
  233.   #define M27_WATCH_OTHER_SOURCES    true     // if true the polling on M27 report is always active. Case: SD print started not from TFT35
  234. #endif
  235.  
  236. /**
  237.  * Power Loss Recovery
  238.  *
  239.  * Most suitable for Delta printers since most printers will crash into printed model when homing after powerloss.
  240.  */
  241. //#define HOME_BEFORE_PLR // Home before power loss recovery
  242. //#define BTT_MINI_UPS // Backup power / UPS to move Z axis on power loss
  243. #define POWER_LOSS_ZRAISE 10 // (mm) Raise Z axis on resume (on power loss with UPS)
  244.  
  245. // Prevent extrusion if the temperature is below set temperature
  246. #define PREVENT_COLD_EXTRUSION_MINTEMP 180
  247.  
  248. /**
  249.  * Maximum hotend temperature of automatic shut down after printing.
  250.  * When enable automatic shutdown(Auto Power), when the hotend temperature is higher than this value
  251.  * turn on the fan to cool down, wait for the hotend temperature to be lower than this value, then turn off the power automatically
  252.  */
  253. #define AUTO_SHUT_DOWN_MAXTEMP 50
  254.  
  255. #define SHOW_FAN_PERCENTAGE // enable to show fan speed as a percentage instead of a value
  256.  
  257. /**
  258.  * Rapid Serial Communication
  259.  *
  260.  * More frequent Serial communicaiton while printing.
  261.  *
  262.  * Send and parse G-codes more frequently while drawing on screen to prevent printer idling and stuttering due to empty printer buffer.
  263.  *
  264.  * Note: This may slow down graphics while switching menus while printing.
  265. */
  266. #define RAPID_SERIAL_COMM
  267.  
  268. /**
  269.  * Custom G-code Commands
  270.  *
  271.  * Support for up to 15 custom G-codes. Uncomment CUSTOM_*_LABEL and CUSTOM_*_GCODE to enable custom G-code.
  272.  *
  273.  * CUSTOM_X_LABEL is the name of the custom button, CUSTOM_X_GCODE is the G-code to be sent by the custom button, this should always end with a New-Line character '\n'
  274.  */
  275. #define CUSTOM_0_LABEL "Disable Steppers"
  276. #define CUSTOM_0_GCODE "M84\n"
  277. #define CUSTOM_1_LABEL "Init SD Card"
  278. #define CUSTOM_1_GCODE "M21\n"
  279. #define CUSTOM_2_LABEL "Release SD Card"
  280. #define CUSTOM_2_GCODE "M22\n"
  281. #define CUSTOM_3_LABEL "Enable Leveling State"
  282. #define CUSTOM_3_GCODE "M420 S1\n"
  283. #define CUSTOM_4_LABEL "Save to EEPROM"
  284. #define CUSTOM_4_GCODE "M500\n"
  285. #define CUSTOM_5_LABEL "Restore from EEPROM"
  286. #define CUSTOM_5_GCODE "M501\n"
  287. #define CUSTOM_6_LABEL "EEPROM Defaults"
  288. #define CUSTOM_6_GCODE "M502\n"
  289. //#define CUSTOM_7_LABEL "Custom7"
  290. //#define CUSTOM_7_GCODE "M105\n"
  291. //#define CUSTOM_8_LABEL "Custom8"
  292. //#define CUSTOM_8_GCODE "M105\n"
  293. //#define CUSTOM_9_LABEL "Custom9"
  294. //#define CUSTOM_9_GCODE "M105\n"
  295. //#define CUSTOM_10_LABEL "Custom10"
  296. //#define CUSTOM_10_GCODE "M105\n"
  297. //#define CUSTOM_11_LABEL "Custom11"
  298. //#define CUSTOM_11_GCODE "M105\n"
  299. //#define CUSTOM_12_LABEL "Custom12"
  300. //#define CUSTOM_12_GCODE "M105\n"
  301. //#define CUSTOM_13_LABEL "Custom13"
  302. //#define CUSTOM_13_GCODE "M105\n"
  303. //#define CUSTOM_14_LABEL "Custom14"
  304. //#define CUSTOM_14_GCODE "M105\n"
  305.  
  306. /**
  307.  * Start/End/Cancel G-code
  308.  *
  309.  * G-code that runs after a print starts, ends, or canceled.
  310.  *
  311.  * Disable in SETTINGS -> FEATURE menu.
  312.  */
  313. // Start G-code - run this G-code before starting print
  314. #define PRINT_START_GCODE "G28\nG29\nG1 Z20\n" // Home all, run ABL routine, raise Z 20 mm
  315.  
  316. // End G-code - run this G-code after finishing print
  317. #define PRINT_END_GCODE "G90\nG1 E-4\nG92 E0\nM18\n" // Switch to absolute positioning, reduce filament pressure by performing small retract, reset extruder position, disable steppers
  318.  
  319. // Cancel G-code - run this G-code after canceling print
  320. #define CANCEL_PRINT_GCODE "G28 XY R10\n" // Raise Z 10mm before homing X & Y
  321.  
  322. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement