Browse Source

New feature: LED_CONTROL_MENU

Tannoo 6 years ago
parent
commit
e25567a5dd
33 changed files with 706 additions and 1 deletions
  1. 15
    0
      Marlin/Configuration_adv.h
  2. 52
    0
      Marlin/Marlin_main.cpp
  3. 15
    0
      Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h
  4. 15
    0
      Marlin/example_configurations/Anet/A6/Configuration_adv.h
  5. 15
    0
      Marlin/example_configurations/Anet/A8/Configuration_adv.h
  6. 15
    0
      Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h
  7. 15
    0
      Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h
  8. 15
    0
      Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h
  9. 15
    0
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  10. 15
    0
      Marlin/example_configurations/Creality/CR-10/Configuration_adv.h
  11. 15
    0
      Marlin/example_configurations/Felix/Configuration_adv.h
  12. 15
    0
      Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h
  13. 15
    0
      Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h
  14. 15
    0
      Marlin/example_configurations/Malyan/M150/Configuration_adv.h
  15. 15
    0
      Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h
  16. 15
    0
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  17. 15
    0
      Marlin/example_configurations/SCARA/Configuration_adv.h
  18. 15
    0
      Marlin/example_configurations/Sanguinololu/Configuration_adv.h
  19. 15
    0
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  20. 15
    0
      Marlin/example_configurations/Velleman/K8200/Configuration_adv.h
  21. 15
    0
      Marlin/example_configurations/Velleman/K8400/Configuration_adv.h
  22. 15
    0
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  23. 15
    0
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  24. 15
    0
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  25. 15
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  26. 15
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  27. 15
    0
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  28. 15
    0
      Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h
  29. 15
    0
      Marlin/example_configurations/makibox/Configuration_adv.h
  30. 15
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  31. 15
    0
      Marlin/example_configurations/wt150/Configuration_adv.h
  32. 57
    1
      Marlin/language_en.h
  33. 147
    0
      Marlin/ultralcd.cpp

+ 15
- 0
Marlin/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 52
- 0
Marlin/Marlin_main.cpp View File

@@ -331,6 +331,32 @@
331 331
   void gcode_G26();
332 332
 #endif
333 333
 
334
+#if ENABLED(LED_CONTROL_MENU)
335
+  #if ENABLED(LED_COLOR_PRESETS)
336
+    uint8_t led_intensity_red = LED_USER_PRESET_RED,
337
+            led_intensity_green = LED_USER_PRESET_GREEN,
338
+            led_intensity_blue = LED_USER_PRESET_BLUE
339
+            #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
340
+              , led_intensity_white = LED_USER_PRESET_WHITE
341
+            #endif
342
+            #if ENABLED(NEOPIXEL_LED)
343
+              , led_intensity = NEOPIXEL_BRIGHTNESS
344
+            #endif
345
+            ;
346
+  #else
347
+    uint8_t led_intensity_red = 255,
348
+            led_intensity_green = 255,
349
+            led_intensity_blue = 255
350
+            #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
351
+              , led_intensity_white = 0
352
+            #endif
353
+            #if ENABLED(NEOPIXEL_LED)
354
+              , led_intensity = NEOPIXEL_BRIGHTNESS
355
+            #endif
356
+            ;
357
+  #endif
358
+#endif
359
+
334 360
 #if ENABLED(SDSUPPORT)
335 361
   CardReader card;
336 362
 #endif
@@ -1101,6 +1127,32 @@ void servo_init() {
1101 1127
       // Update I2C LED driver
1102 1128
       PCA9632_SetColor(r, g, b);
1103 1129
     #endif
1130
+
1131
+    #if ENABLED(LED_CONTROL_MENU)
1132
+      if ((r + g + b
1133
+        #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
1134
+          + w
1135
+        #endif
1136
+      ) >= 3) {
1137
+        led_intensity_red = r;
1138
+        led_intensity_green = g;
1139
+        led_intensity_blue = b;
1140
+        #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
1141
+          led_intensity_white = w;
1142
+        #endif
1143
+        #if ENABLED(NEOPIXEL_LED)
1144
+          led_intensity = p;
1145
+        #endif
1146
+      }
1147
+    #endif
1148
+  }
1149
+
1150
+  void set_led_white() {
1151
+    #if ENABLED(NEOPIXEL_LED)
1152
+      set_neopixel_color(pixels.Color(NEO_WHITE));
1153
+    #else
1154
+      set_led_color(LED_WHITE);
1155
+    #endif
1104 1156
   }
1105 1157
 
1106 1158
 #endif // HAS_COLOR_LEDS

+ 15
- 0
Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/Anet/A6/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/Anet/A8/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/Creality/CR-10/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/FolgerTech/i3-2020/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/Malyan/M150/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/Micromake/C1/enhanced/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/Sanguinololu/Configuration_adv.h View File

@@ -471,6 +471,21 @@
471 471
 // The timeout (in ms) to return to the status screen from sub-menus
472 472
 //#define LCD_TIMEOUT_TO_STATUS 15000
473 473
 
474
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
475
+#if ENABLED(LED_CONTROL_MENU)
476
+
477
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
478
+    #if ENABLED(LED_COLOR_PRESETS)
479
+      #define LED_USER_PRESET_RED       255   // User defined RED value
480
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
481
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
482
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
483
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
484
+
485
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
486
+    #endif
487
+#endif // LED_CONTROL_MENU
488
+
474 489
 #if ENABLED(SDSUPPORT)
475 490
 
476 491
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/TinyBoy2/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/Velleman/K8200/Configuration_adv.h View File

@@ -495,6 +495,21 @@
495 495
 // The timeout (in ms) to return to the status screen from sub-menus
496 496
 //#define LCD_TIMEOUT_TO_STATUS 15000
497 497
 
498
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
499
+#if ENABLED(LED_CONTROL_MENU)
500
+
501
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
502
+    #if ENABLED(LED_COLOR_PRESETS)
503
+      #define LED_USER_PRESET_RED       255   // User defined RED value
504
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
505
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
506
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
507
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
508
+
509
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
510
+    #endif
511
+#endif // LED_CONTROL_MENU
512
+
498 513
 #if ENABLED(SDSUPPORT)
499 514
 
500 515
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/Velleman/K8400/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h View File

@@ -484,6 +484,21 @@
484 484
 // The timeout (in ms) to return to the status screen from sub-menus
485 485
 //#define LCD_TIMEOUT_TO_STATUS 15000
486 486
 
487
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
488
+#if ENABLED(LED_CONTROL_MENU)
489
+
490
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
491
+    #if ENABLED(LED_COLOR_PRESETS)
492
+      #define LED_USER_PRESET_RED       255   // User defined RED value
493
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
494
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
495
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
496
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
497
+
498
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
499
+    #endif
500
+#endif // LED_CONTROL_MENU
501
+
487 502
 #if ENABLED(SDSUPPORT)
488 503
 
489 504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h View File

@@ -484,6 +484,21 @@
484 484
 // The timeout (in ms) to return to the status screen from sub-menus
485 485
 //#define LCD_TIMEOUT_TO_STATUS 15000
486 486
 
487
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
488
+#if ENABLED(LED_CONTROL_MENU)
489
+
490
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
491
+    #if ENABLED(LED_COLOR_PRESETS)
492
+      #define LED_USER_PRESET_RED       255   // User defined RED value
493
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
494
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
495
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
496
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
497
+
498
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
499
+    #endif
500
+#endif // LED_CONTROL_MENU
501
+
487 502
 #if ENABLED(SDSUPPORT)
488 503
 
489 504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -484,6 +484,21 @@
484 484
 // The timeout (in ms) to return to the status screen from sub-menus
485 485
 //#define LCD_TIMEOUT_TO_STATUS 15000
486 486
 
487
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
488
+#if ENABLED(LED_CONTROL_MENU)
489
+
490
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
491
+    #if ENABLED(LED_COLOR_PRESETS)
492
+      #define LED_USER_PRESET_RED       255   // User defined RED value
493
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
494
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
495
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
496
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
497
+
498
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
499
+    #endif
500
+#endif // LED_CONTROL_MENU
501
+
487 502
 #if ENABLED(SDSUPPORT)
488 503
 
489 504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -484,6 +484,21 @@
484 484
 // The timeout (in ms) to return to the status screen from sub-menus
485 485
 //#define LCD_TIMEOUT_TO_STATUS 15000
486 486
 
487
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
488
+#if ENABLED(LED_CONTROL_MENU)
489
+
490
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
491
+    #if ENABLED(LED_COLOR_PRESETS)
492
+      #define LED_USER_PRESET_RED       255   // User defined RED value
493
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
494
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
495
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
496
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
497
+
498
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
499
+    #endif
500
+#endif // LED_CONTROL_MENU
501
+
487 502
 #if ENABLED(SDSUPPORT)
488 503
 
489 504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

@@ -489,6 +489,21 @@
489 489
 // The timeout (in ms) to return to the status screen from sub-menus
490 490
 //#define LCD_TIMEOUT_TO_STATUS 15000
491 491
 
492
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
493
+#if ENABLED(LED_CONTROL_MENU)
494
+
495
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
496
+    #if ENABLED(LED_COLOR_PRESETS)
497
+      #define LED_USER_PRESET_RED       255   // User defined RED value
498
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
499
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
500
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
501
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
502
+
503
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
504
+    #endif
505
+#endif // LED_CONTROL_MENU
506
+
492 507
 #if ENABLED(SDSUPPORT)
493 508
 
494 509
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

@@ -484,6 +484,21 @@
484 484
 // The timeout (in ms) to return to the status screen from sub-menus
485 485
 //#define LCD_TIMEOUT_TO_STATUS 15000
486 486
 
487
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
488
+#if ENABLED(LED_CONTROL_MENU)
489
+
490
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
491
+    #if ENABLED(LED_COLOR_PRESETS)
492
+      #define LED_USER_PRESET_RED       255   // User defined RED value
493
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
494
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
495
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
496
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
497
+
498
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
499
+    #endif
500
+#endif // LED_CONTROL_MENU
501
+
487 502
 #if ENABLED(SDSUPPORT)
488 503
 
489 504
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -482,6 +482,21 @@
482 482
 // The timeout (in ms) to return to the status screen from sub-menus
483 483
 //#define LCD_TIMEOUT_TO_STATUS 15000
484 484
 
485
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
486
+#if ENABLED(LED_CONTROL_MENU)
487
+
488
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
489
+    #if ENABLED(LED_COLOR_PRESETS)
490
+      #define LED_USER_PRESET_RED       255   // User defined RED value
491
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
492
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
493
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
494
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
495
+
496
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
497
+    #endif
498
+#endif // LED_CONTROL_MENU
499
+
485 500
 #if ENABLED(SDSUPPORT)
486 501
 
487 502
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 15
- 0
Marlin/example_configurations/wt150/Configuration_adv.h View File

@@ -472,6 +472,21 @@
472 472
 // The timeout (in ms) to return to the status screen from sub-menus
473 473
 //#define LCD_TIMEOUT_TO_STATUS 15000
474 474
 
475
+//#define LED_CONTROL_MENU                       // Uncomment to enable the LED control menu option.
476
+#if ENABLED(LED_CONTROL_MENU)
477
+
478
+  #define LED_COLOR_PRESETS                   // Uncomment to enable the preset color menu option.
479
+    #if ENABLED(LED_COLOR_PRESETS)
480
+      #define LED_USER_PRESET_RED       255   // User defined RED value
481
+      #define LED_USER_PRESET_GREEN     128   // User defined GREEN value
482
+      #define LED_USER_PRESET_BLUE        0   // User defined BLUE value
483
+      #define LED_USER_PRESET_WHITE     255   // User defined WHITE value
484
+      #define LED_USER_PRESET_INTENSITY 255   // User defined intensity
485
+
486
+      //#define LED_USER_PRESET_STARTUP         // Have the printer display the user preset color on startup
487
+    #endif
488
+#endif // LED_CONTROL_MENU
489
+
475 490
 #if ENABLED(SDSUPPORT)
476 491
 
477 492
   // Some RAMPS and other boards don't detect when an SD card is inserted. You can work

+ 57
- 1
Marlin/language_en.h View File

@@ -361,7 +361,63 @@
361 361
 #ifndef MSG_UBL_STEP_BY_STEP_MENU
362 362
   #define MSG_UBL_STEP_BY_STEP_MENU           _UxGT("Step-By-Step UBL")
363 363
 #endif
364
-
364
+#ifndef MSG_LED_CONTROL
365
+  #define MSG_LED_CONTROL                     _UxGT("LED Control")
366
+#endif
367
+#ifndef MSG_LEDS_OFF
368
+  #define MSG_LEDS_OFF                        _UxGT("Turn Off Lights")
369
+#endif
370
+#ifndef MSG_LED_ON
371
+  #define MSG_LED_ON                          _UxGT("Turn on ")
372
+#endif
373
+#ifndef MSG_RED
374
+  #define MSG_RED                             _UxGT("Red ")
375
+#endif
376
+#ifndef MSG_ORANGE
377
+  #define MSG_ORANGE                          _UxGT("Orange ")
378
+#endif
379
+#ifndef MSG_YELLOW
380
+  #define MSG_YELLOW                          _UxGT("Yellow ")
381
+#endif
382
+#ifndef MSG_GREEN
383
+  #define MSG_GREEN                           _UxGT("Green ")
384
+#endif
385
+#ifndef MSG_BLUE
386
+  #define MSG_BLUE                            _UxGT("Blue ")
387
+#endif
388
+#ifndef MSG_PURPLE
389
+  #define MSG_PURPLE                          _UxGT("Purple ")
390
+#endif
391
+#ifndef MSG_WHITE
392
+  #define MSG_WHITE                           _UxGT("White ")
393
+#endif
394
+#ifndef MSG_CUSTOM
395
+  #define MSG_CUSTOM                          _UxGT("Custom ")
396
+#endif
397
+#ifndef MSG_LED_PRESET
398
+  #define MSG_LED_PRESET                      _UxGT("Preset ")
399
+#endif
400
+#ifndef MSG_LED_DEFAULT
401
+  #define MSG_LED_DEFAULT                     _UxGT("Default ")
402
+#endif
403
+#ifndef MSG_LIGHTS
404
+  #define MSG_LIGHTS                          _UxGT("Lights ")
405
+#endif
406
+#ifndef MSG_COLOR
407
+  #define MSG_COLOR                           _UxGT("Color")
408
+#endif
409
+#ifndef MSG_LED_INTENSITY
410
+  #define MSG_LED_INTENSITY                   _UxGT("Intensity ")
411
+#endif
412
+#ifndef MSG_LED_CUSTOM
413
+  #define MSG_LED_CUSTOM                      _UxGT("Custom LED")
414
+#endif
415
+#ifndef MSG_LED_SAVE
416
+  #define MSG_LED_SAVE                        _UxGT("Save ")
417
+#endif
418
+#ifndef MSG_LED_LOAD
419
+  #define MSG_LED_LOAD                        _UxGT("Load ")
420
+#endif
365 421
 #ifndef MSG_MOVING
366 422
   #define MSG_MOVING                          _UxGT("Moving...")
367 423
 #endif

+ 147
- 0
Marlin/ultralcd.cpp View File

@@ -184,6 +184,23 @@ uint16_t max_display_update_time = 0;
184 184
     void lcd_info_menu();
185 185
   #endif // LCD_INFO_MENU
186 186
 
187
+  #if ENABLED(LED_CONTROL_MENU)
188
+    extern void set_led_color(
189
+             const uint8_t r, const uint8_t g, const uint8_t b
190
+               #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
191
+                 , const uint8_t w = 0
192
+                 #if ENABLED(NEOPIXEL_LED)
193
+                   , const uint8_t p = NEOPIXEL_BRIGHTNESS
194
+                   , bool isSequence = false
195
+                 #endif
196
+               #endif
197
+           );
198
+
199
+    extern void set_led_white();
200
+    void lcd_led_menu();
201
+    void lcd_led_custom_menu();
202
+  #endif
203
+
187 204
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
188 205
     void lcd_advanced_pause_toocold_menu();
189 206
     void lcd_advanced_pause_option_menu();
@@ -1013,6 +1030,10 @@ void kill_screen(const char* lcd_msg) {
1013 1030
       MENU_ITEM(submenu, MSG_INFO_MENU, lcd_info_menu);
1014 1031
     #endif
1015 1032
 
1033
+    #if ENABLED(LED_CONTROL_MENU)
1034
+      MENU_ITEM(submenu, "LED Control", lcd_led_menu);
1035
+    #endif
1036
+
1016 1037
     END_MENU();
1017 1038
   }
1018 1039
 
@@ -3944,6 +3965,132 @@ void kill_screen(const char* lcd_msg) {
3944 3965
 
3945 3966
   /**
3946 3967
    *
3968
+   * LED Menu
3969
+   *
3970
+   */
3971
+
3972
+  #if ENABLED(LED_CONTROL_MENU)
3973
+
3974
+    bool led_restore_color =
3975
+      #if ENABLED(LED_USER_PRESET_STARTUP)
3976
+        false;
3977
+      #else
3978
+        true;
3979
+      #endif
3980
+
3981
+    extern uint8_t led_intensity_red,
3982
+           led_intensity_green,
3983
+           led_intensity_blue
3984
+           #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
3985
+             , led_intensity_white
3986
+           #endif
3987
+           #if ENABLED(NEOPIXEL_LED)
3988
+             , led_intensity
3989
+           #endif
3990
+           ;
3991
+
3992
+    void update_leds() {
3993
+      if (led_restore_color) {
3994
+        #if ENABLED(LED_COLOR_PRESETS)
3995
+          led_intensity_red = LED_USER_PRESET_RED;
3996
+          led_intensity_green = LED_USER_PRESET_GREEN;
3997
+          led_intensity_blue = LED_USER_PRESET_BLUE;
3998
+          #if ENABLED(RGBW_LED)
3999
+            led_intensity_white = LED_USER_PRESET_WHITE;
4000
+          #endif
4001
+          #if ENABLED(NEOPIXEL_LED)
4002
+            led_intensity = LED_USER_PRESET_INTENSITY;
4003
+          #endif
4004
+        #else
4005
+          led_intensity_red = 255;
4006
+          led_intensity_green = 255;
4007
+          led_intensity_blue = 255;
4008
+          #if ENABLED(RGBW_LED)
4009
+            led_intensity_white = 0;
4010
+          #endif
4011
+          #if ENABLED(NEOPIXEL_LED)
4012
+            led_intensity = LED_USER_PRESET_INTENSITY;
4013
+          #endif
4014
+        #endif
4015
+        led_restore_color = false;
4016
+      }
4017
+
4018
+      set_led_color(led_intensity_red, led_intensity_green, led_intensity_blue
4019
+        #if ENABLED(RGBW_LED)
4020
+          , led_intensity_white
4021
+        #endif
4022
+        #if ENABLED(NEOPIXEL_LED)
4023
+          , 0, led_intensity
4024
+        #endif
4025
+        );
4026
+      led_restore_color = false;
4027
+    }
4028
+
4029
+    void led_restore_default() {
4030
+      led_restore_color = true;
4031
+      update_leds();
4032
+    }
4033
+
4034
+    void set_leds_off() {
4035
+      set_led_color(0, 0, 0
4036
+        #if ENABLED(RGBW) || ENABLED(NEOPIXEL_LED)
4037
+        , 0
4038
+        #endif
4039
+        );
4040
+    }
4041
+
4042
+    void lcd_led_red()    { set_led_color(255, 0, 0); }
4043
+    void lcd_led_orange() { set_led_color(150, 60, 0); }
4044
+    void lcd_led_yellow() { set_led_color(255, 255, 0); }
4045
+    void lcd_led_green()  { set_led_color(0, 255, 0); }
4046
+    void lcd_led_blue()   { set_led_color(0, 0, 255); }
4047
+    void lcd_led_purple() { set_led_color(255, 0, 255); }
4048
+
4049
+    void lcd_led_presets_menu() {
4050
+      START_MENU();
4051
+      MENU_BACK(MSG_LED_CONTROL);
4052
+      MENU_ITEM(function, MSG_LED_ON MSG_RED MSG_LIGHTS, lcd_led_red);
4053
+      MENU_ITEM(function, MSG_LED_ON MSG_ORANGE MSG_LIGHTS, lcd_led_orange);
4054
+      MENU_ITEM(function, MSG_LED_ON MSG_YELLOW MSG_LIGHTS,lcd_led_yellow);
4055
+      MENU_ITEM(function, MSG_LED_ON MSG_GREEN MSG_LIGHTS, lcd_led_green);
4056
+      MENU_ITEM(function, MSG_LED_ON MSG_BLUE MSG_LIGHTS, lcd_led_blue);
4057
+      MENU_ITEM(function, MSG_LED_ON MSG_PURPLE MSG_LIGHTS, lcd_led_purple);
4058
+      MENU_ITEM(function, MSG_LED_ON MSG_WHITE MSG_LIGHTS, set_led_white);
4059
+      END_MENU();
4060
+    }
4061
+
4062
+    void lcd_led_custom_menu() {
4063
+      START_MENU();
4064
+      MENU_BACK(MSG_LED_CONTROL);
4065
+      MENU_ITEM_EDIT_CALLBACK(int8, MSG_RED MSG_LED_INTENSITY, &led_intensity_red, 0, 255, update_leds, true);
4066
+      MENU_ITEM_EDIT_CALLBACK(int8, MSG_GREEN MSG_LED_INTENSITY, &led_intensity_green, 0, 255, update_leds, true);
4067
+      MENU_ITEM_EDIT_CALLBACK(int8, MSG_BLUE MSG_LED_INTENSITY, &led_intensity_blue, 0, 255, update_leds, true);
4068
+      #if ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED)
4069
+        MENU_ITEM_EDIT_CALLBACK(int8, MSG_WHITE MSG_LED_INTENSITY, &led_intensity_white, 0, 255, update_leds, true);
4070
+      #endif
4071
+      #if ENABLED(NEOPIXEL_LED)
4072
+        MENU_ITEM_EDIT_CALLBACK(int8, MSG_LED_INTENSITY, &led_intensity, 0, 255, update_leds, true);
4073
+      #endif
4074
+      END_MENU();
4075
+    }
4076
+
4077
+    void lcd_led_menu() {
4078
+      START_MENU();
4079
+      MENU_BACK(MSG_MAIN);
4080
+      MENU_ITEM(function, MSG_LIGHTS MSG_OFF, set_leds_off); // works
4081
+      MENU_ITEM(function, MSG_LIGHTS MSG_ON, update_leds); // works
4082
+      MENU_ITEM(function, MSG_LED_LOAD MSG_LED_DEFAULT MSG_COLOR, led_restore_default); // works
4083
+      #if ENABLED(LED_COLOR_PRESETS)
4084
+        MENU_ITEM(submenu, MSG_LED_PRESET MSG_LIGHTS, lcd_led_presets_menu);
4085
+      #endif
4086
+      MENU_ITEM(submenu, MSG_CUSTOM MSG_LIGHTS, lcd_led_custom_menu);
4087
+      END_MENU();
4088
+    }
4089
+
4090
+  #endif // LED_CONTROL_MENU
4091
+
4092
+  /**
4093
+   *
3947 4094
    * Filament Change Feature Screens
3948 4095
    *
3949 4096
    */

Loading…
Cancel
Save