diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h index 511cb019eadb9ab702aba0d87cdb107eec4349c0..d69b1b1ec781222e7a131573fb50faae1597807e 100644 --- a/Marlin/Conditionals_LCD.h +++ b/Marlin/Conditionals_LCD.h @@ -385,5 +385,7 @@ #endif #define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS)) + #define HAS_RESUME_CONTINUE (ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER)) + #define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED)) #endif //CONDITIONALS_LCD_H diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index e17a2db8a035ecc42f230e5d36b9fc8ed60fe7ee..cc57bff662ee371c60d9dd05ea3449791de544a2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1514,12 +1514,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index a8c85848f872439ad0420da9113fff1f30a85a7e..d58cc6e27dee86c34b55d564a2f9630b9e0c6218 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -221,7 +221,7 @@ extern bool axis_known_position[XYZ]; // axis[n].is_known extern bool axis_homed[XYZ]; // axis[n].is_homed extern volatile bool wait_for_heatup; -#if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL) +#if HAS_RESUME_CONTINUE extern volatile bool wait_for_user; #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7f7d93178d3eca9e18451447678f05953fc4b2dd..fa7c9b1cdb21c0811c7d896419e63d1aa49bb4ce 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -443,7 +443,7 @@ static bool relative_mode = false; volatile bool wait_for_heatup = true; // For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop -#if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL) +#if HAS_RESUME_CONTINUE volatile bool wait_for_user = false; #endif @@ -945,6 +945,41 @@ void servo_init() { #endif +#if HAS_COLOR_LEDS + + void set_led_color( + const uint8_t r, const uint8_t g, const uint8_t b + #if ENABLED(RGBW_LED) + , const uint8_t w=0 + #endif + ) { + + #if ENABLED(BLINKM) + + // This variant uses i2c to send the RGB components to the device. + SendColors(r, g, b); + + #else + + // This variant uses 3 separate pins for the RGB components. + // If the pins can do PWM then their intensity will be set. + digitalWrite(RGB_LED_R_PIN, r ? HIGH : LOW); + digitalWrite(RGB_LED_G_PIN, g ? HIGH : LOW); + digitalWrite(RGB_LED_B_PIN, b ? HIGH : LOW); + analogWrite(RGB_LED_R_PIN, r); + analogWrite(RGB_LED_G_PIN, g); + analogWrite(RGB_LED_B_PIN, b); + + #if ENABLED(RGBW_LED) + digitalWrite(RGB_LED_W_PIN, w ? HIGH : LOW); + analogWrite(RGB_LED_W_PIN, w); + #endif + + #endif + } + +#endif // HAS_COLOR_LEDS + void gcode_line_error(const char* err, bool doFlush = true) { SERIAL_ERROR_START; serialprintPGM(err); @@ -1129,6 +1164,19 @@ inline void get_serial_commands() { if (card_eof) { SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED); card.printingHasFinished(); + #if ENABLED(PRINTER_EVENT_LEDS) + LCD_MESSAGEPGM(MSG_INFO_COMPLETED_PRINTS); + set_led_color(0, 255, 0); // Green + #if HAS_RESUME_CONTINUE + KEEPALIVE_STATE(PAUSED_FOR_USER); + wait_for_user = true; + while (wait_for_user) idle(); + KEEPALIVE_STATE(IN_HANDLER); + #else + safe_delay(1000); + #endif + set_led_color(0, 0, 0); // OFF + #endif card.checkautostart(true); } else if (n == -1) { @@ -4967,7 +5015,7 @@ inline void gcode_G92() { report_current_position(); } -#if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL) +#if HAS_RESUME_CONTINUE /** * M0: Unconditional stop - Wait for user button press on LCD @@ -5504,7 +5552,7 @@ inline void gcode_M42() { pin_state[pin - first_pin] = digitalRead(pin); } - #if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL) + #if HAS_RESUME_CONTINUE wait_for_user = true; #endif @@ -5522,7 +5570,7 @@ inline void gcode_M42() { } } - #if ENABLED(EMERGENCY_PARSER) || ENABLED(ULTIPANEL) + #if HAS_RESUME_CONTINUE if (!wait_for_user) break; #endif @@ -5692,8 +5740,8 @@ inline void gcode_M42() { // If we have gone out too far, we can do a simple fix and scale the numbers // back in closer to the origin. while (HYPOT(X_current, Y_current) > DELTA_PROBEABLE_RADIUS) { - X_current /= 1.25; - Y_current /= 1.25; + X_current *= 0.8; + Y_current *= 0.8; if (verbose_level > 3) { SERIAL_ECHOPAIR("Pulling point towards center:", X_current); SERIAL_ECHOLNPAIR(", ", Y_current); @@ -6077,18 +6125,23 @@ inline void gcode_M109() { #define TEMP_CONDITIONS (wants_to_cool ? thermalManager.isCoolingHotend(target_extruder) : thermalManager.isHeatingHotend(target_extruder)) #endif - float theTarget = -1.0, old_temp = 9999.0; + float target_temp = -1.0, old_temp = 9999.0; bool wants_to_cool = false; wait_for_heatup = true; millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; KEEPALIVE_STATE(NOT_BUSY); + #if ENABLED(PRINTER_EVENT_LEDS) + const float start_temp = thermalManager.degHotend(target_extruder); + uint8_t old_blue = 0; + #endif + do { // Target temperature might be changed during the loop - if (theTarget != thermalManager.degTargetHotend(target_extruder)) { + if (target_temp != thermalManager.degTargetHotend(target_extruder)) { wants_to_cool = thermalManager.isCoolingHotend(target_extruder); - theTarget = thermalManager.degTargetHotend(target_extruder); + target_temp = thermalManager.degTargetHotend(target_extruder); // Exit if S<lower>, continue if S<higher>, R<lower>, or R<higher> if (no_wait_for_cooling && wants_to_cool) break; @@ -6115,11 +6168,19 @@ inline void gcode_M109() { idle(); refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out - float temp = thermalManager.degHotend(target_extruder); + const float temp = thermalManager.degHotend(target_extruder); + + #if ENABLED(PRINTER_EVENT_LEDS) + // Gradually change LED strip from violet to red as nozzle heats up + if (!wants_to_cool) { + const uint8_t blue = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 255, 0); + if (blue != old_blue) set_led_color(255, 0, (old_blue = blue)); + } + #endif #if TEMP_RESIDENCY_TIME > 0 - float temp_diff = fabs(theTarget - temp); + const float temp_diff = fabs(target_temp - temp); if (!residency_start_ms) { // Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time. @@ -6145,7 +6206,16 @@ inline void gcode_M109() { } while (wait_for_heatup && TEMP_CONDITIONS); - if (wait_for_heatup) LCD_MESSAGEPGM(MSG_HEATING_COMPLETE); + if (wait_for_heatup) { + LCD_MESSAGEPGM(MSG_HEATING_COMPLETE); + #if ENABLED(PRINTER_EVENT_LEDS) + #if ENABLED(RGBW_LED) + set_led_color(0, 0, 0, 255); // Turn on the WHITE LED + #else + set_led_color(255, 255, 255); // Set LEDs All On + #endif + #endif + } KEEPALIVE_STATE(IN_HANDLER); } @@ -6186,7 +6256,7 @@ inline void gcode_M109() { #define TEMP_BED_CONDITIONS (wants_to_cool ? thermalManager.isCoolingBed() : thermalManager.isHeatingBed()) #endif - float theTarget = -1.0, old_temp = 9999.0; + float target_temp = -1.0, old_temp = 9999.0; bool wants_to_cool = false; wait_for_heatup = true; millis_t now, next_temp_ms = 0, next_cool_check_ms = 0; @@ -6195,11 +6265,16 @@ inline void gcode_M109() { target_extruder = active_extruder; // for print_heaterstates + #if ENABLED(PRINTER_EVENT_LEDS) + const float start_temp = thermalManager.degBed(); + uint8_t old_red = 255; + #endif + do { // Target temperature might be changed during the loop - if (theTarget != thermalManager.degTargetBed()) { + if (target_temp != thermalManager.degTargetBed()) { wants_to_cool = thermalManager.isCoolingBed(); - theTarget = thermalManager.degTargetBed(); + target_temp = thermalManager.degTargetBed(); // Exit if S<lower>, continue if S<higher>, R<lower>, or R<higher> if (no_wait_for_cooling && wants_to_cool) break; @@ -6226,11 +6301,20 @@ inline void gcode_M109() { idle(); refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out - float temp = thermalManager.degBed(); + const float temp = thermalManager.degBed(); + + #if ENABLED(PRINTER_EVENT_LEDS) + // Gradually change LED strip from blue to violet as bed heats up + if (!wants_to_cool) { + const uint8_t red = map(constrain(temp, start_temp, target_temp), start_temp, target_temp, 0, 255); + if (red != old_red) set_led_color((old_red = red), 0, 255); + } + } + #endif #if TEMP_BED_RESIDENCY_TIME > 0 - float temp_diff = fabs(theTarget - temp); + const float temp_diff = fabs(target_temp - temp); if (!residency_start_ms) { // Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time. @@ -6771,33 +6855,12 @@ inline void gcode_M121() { endstops.enable_globally(false); } #endif // PARK_HEAD_ON_PAUSE -#if ENABLED(BLINKM) || ENABLED(RGB_LED) - - void set_led_color(const uint8_t r, const uint8_t g, const uint8_t b) { - - #if ENABLED(BLINKM) - - // This variant uses i2c to send the RGB components to the device. - SendColors(r, g, b); - - #else - - // This variant uses 3 separate pins for the RGB components. - // If the pins can do PWM then their intensity will be set. - digitalWrite(RGB_LED_R_PIN, r ? HIGH : LOW); - digitalWrite(RGB_LED_G_PIN, g ? HIGH : LOW); - digitalWrite(RGB_LED_B_PIN, b ? HIGH : LOW); - analogWrite(RGB_LED_R_PIN, r); - analogWrite(RGB_LED_G_PIN, g); - analogWrite(RGB_LED_B_PIN, b); - - #endif - } +#if HAS_COLOR_LEDS /** - * M150: Set Status LED Color - Use R-U-B for R-G-B + * M150: Set Status LED Color - Use R-U-B-W for R-G-B-W * - * Always sets all 3 components. If a component is left out, set to 0. + * Always sets all 3 or 4 components. If a component is left out, set to 0. * * Examples: * @@ -6805,6 +6868,7 @@ inline void gcode_M121() { endstops.enable_globally(false); } * M150 R255 U127 ; Turn LED orange (PWM only) * M150 ; Turn LED off * M150 R U B ; Turn LED white + * M150 W ; Turn LED white using a white LED * */ inline void gcode_M150() { @@ -6812,6 +6876,9 @@ inline void gcode_M121() { endstops.enable_globally(false); } code_seen('R') ? (code_has_value() ? code_value_byte() : 255) : 0, code_seen('U') ? (code_has_value() ? code_value_byte() : 255) : 0, code_seen('B') ? (code_has_value() ? code_value_byte() : 255) : 0 + #if ENABLED(RGBW_LED) + , code_seen('W') ? (code_has_value() ? code_value_byte() : 255) : 0 + #endif ); } @@ -8266,7 +8333,7 @@ inline void gcode_M503() { inline void gcode_M605() { stepper.synchronize(); - extruder_duplication_enabled = code_seen('S') && code_value_int() == 2; + extruder_duplication_enabled = code_seen('S') && code_value_int() == (int)DXC_DUPLICATION_MODE; SERIAL_ECHO_START; SERIAL_ECHOLNPAIR(MSG_DUPLICATION_MODE, extruder_duplication_enabled ? MSG_ON : MSG_OFF); } @@ -9139,7 +9206,7 @@ void process_next_command() { break; case 'M': switch (codenum) { - #if ENABLED(ULTIPANEL) || ENABLED(EMERGENCY_PARSER) + #if HAS_RESUME_CONTINUE case 0: // M0: Unconditional stop - Wait for user button press on LCD case 1: // M1: Conditional stop - Wait for user button press on LCD gcode_M0_M1(); @@ -9388,7 +9455,7 @@ void process_next_command() { break; #endif - #if ENABLED(BLINKM) || ENABLED(RGB_LED) + #if HAS_COLOR_LEDS case 150: // M150: Set Status LED Color gcode_M150(); diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 0a36616d15500cb7e2d2c1617c1f2bf78f12dd48..b2e271aa17c171406daeab9c8ab411d70c20c7c4 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -34,10 +34,10 @@ #endif /** - * We try our best to include sanity checks for all the changes configuration - * directives because people have a tendency to use outdated config files with - * the bleding edge source code, but sometimes this is not enough. This check - * will force a minimum config file revision, otherwise Marlin will not build. + * We try our best to include sanity checks for all changed configuration + * directives because users have a tendency to use outdated config files with + * the bleeding-edge source code, but sometimes this is not enough. This check + * forces a minimum config file revision. Otherwise Marlin will not build. */ #if ! defined(CONFIGURATION_H_VERSION) || CONFIGURATION_H_VERSION < REQUIRED_CONFIGURATION_H_VERSION #error "You are using an old Configuration.h file, update it before building Marlin." @@ -951,12 +951,23 @@ static_assert(1 >= 0 /** * RGB_LED Requirements */ +#define _RGB_TEST (PIN_EXISTS(RGB_LED_R) && PIN_EXISTS(RGB_LED_G) && PIN_EXISTS(RGB_LED_B)) #if ENABLED(RGB_LED) - #if !(PIN_EXISTS(RGB_LED_R) && PIN_EXISTS(RGB_LED_G) && PIN_EXISTS(RGB_LED_B)) + #if !_RGB_TEST #error "RGB_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, and RGB_LED_B_PIN." + #elif ENABLED(RGBW_LED) + #error "Please enable only one of RGB_LED and RGBW_LED." #elif ENABLED(BLINKM) #error "RGB_LED and BLINKM are currently incompatible (both use M150)." #endif +#elif ENABLED(RGBW_LED) + #if !(_RGB_TEST && PIN_EXISTS(RGB_LED_W)) + #error "RGBW_LED requires RGB_LED_R_PIN, RGB_LED_G_PIN, RGB_LED_B_PIN, and RGB_LED_W_PIN." + #elif ENABLED(BLINKM) + #error "RGBW_LED and BLINKM are currently incompatible (both use M150)." + #endif +#elif DISABLED(BLINKM) && ENABLED(PRINTER_EVENT_LEDS) + #error "PRINTER_EVENT_LEDS requires BLINKM, RGB_LED, or RGBW_LED." #endif /** diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 62d6d8170d3b0fb2157c4bfb33117118d6d10d7d..6a2382fa46ac7ac75f47fe665d84d9417a8fd082 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -1513,12 +1513,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 71b26a7f1ea01e7189afbb779be6ae4bdce8c5e1..f7cf0e3241de7f2ac493d7bb974a15f93728838b 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -1497,12 +1497,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 59e5faeab2452557c2fc08ba0fac950dbed3ee26..96b9eb19c8423628b31baadad739087a02a41b46 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -1497,12 +1497,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h index fef9f3657a22440d456145062d1cc34f7066c5fc..5488cf6e7cff6bd5cdbd28fadd6bd50f95953f30 100644 --- a/Marlin/example_configurations/Hephestos/Configuration.h +++ b/Marlin/example_configurations/Hephestos/Configuration.h @@ -1505,12 +1505,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/Hephestos_2/Configuration.h b/Marlin/example_configurations/Hephestos_2/Configuration.h index 2d4abfda9a36b0eba13a411348b2e8b28da3d5cc..277bf536459a867a32502ebd34159186a39b1327 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration.h @@ -1508,12 +1508,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h index 2bebbd648141f83c6f47f53ce78af0e65828bc6f..be48f771d3173ee22692e7de42f5fc3c9bec3f17 100644 --- a/Marlin/example_configurations/K8200/Configuration.h +++ b/Marlin/example_configurations/K8200/Configuration.h @@ -1548,12 +1548,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/K8400/Configuration.h b/Marlin/example_configurations/K8400/Configuration.h index 0b9547453599a7ee07638cb19d250d8c2eba6c02..94565900044a84328de84fda27c4a962faedd6ef 100644 --- a/Marlin/example_configurations/K8400/Configuration.h +++ b/Marlin/example_configurations/K8400/Configuration.h @@ -1514,12 +1514,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/K8400/Dual-head/Configuration.h index 63c3036e6dc5f00ef19df420f6ad34e847ab8406..4a4d29dc13153cb3da435511337c6016cb1753f2 100644 --- a/Marlin/example_configurations/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/K8400/Dual-head/Configuration.h @@ -1514,12 +1514,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index f5e44da8babf48e313cede1bcdce3aa8d502009b..6b521ff03a8943b25e18c54972aeaf881731aea4 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -1514,12 +1514,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index a7f1bb8f2ec925693ba231c5666d6803d3349bf6..b5b33631699056b8b77d33a3a5159128d81acd5e 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -1515,12 +1515,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 29352b0daec68eb4a2c0ad9bcc4b645515924942..b116d9f9abebbfb80b2142d140a023f1abce8969 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -1529,12 +1529,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/TAZ4/Configuration.h b/Marlin/example_configurations/TAZ4/Configuration.h index 03100e59c264ecc78644c1b014b4c36c0ec894bd..4960cf1d5c08ca1a1016897558b5fd8bb37710cd 100644 --- a/Marlin/example_configurations/TAZ4/Configuration.h +++ b/Marlin/example_configurations/TAZ4/Configuration.h @@ -1534,12 +1534,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/TinyBoy2/Configuration.h b/Marlin/example_configurations/TinyBoy2/Configuration.h index ce24a344edc2eda23c3fb35f5a4a2eaa7e2d2602..8fce9fa9794f11d47571dac3e3451ad78f03f0a2 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration.h @@ -1570,12 +1570,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h index 7c69e1b1eb4ff6a0bc2827e6f7e7828ead560b09..ffa1fe60aba81fe38c40293a53ca81cea111d2bc 100644 --- a/Marlin/example_configurations/WITBOX/Configuration.h +++ b/Marlin/example_configurations/WITBOX/Configuration.h @@ -1505,12 +1505,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index 55fde5dc673d852cc09bf50532e7788c447e53a9..eaf532eb266f4a0bf70156ec34eec1d8bb30eb6f 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -1514,12 +1514,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h index 0aeef6f293c33303213d606344950692cba91dd1..d66f45e2f0ff5babba3042d9c8f9cd058b3c07d6 100644 --- a/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/flsun_kossel_mini/Configuration.h @@ -1630,12 +1630,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 6ea0062adab5879db172f1c7a4d08e48663aca12..4716101a3763a7dc95aaa97e20249ce7ff9b6a90 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -1616,12 +1616,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index ebd147e1f14fe9bd95559e6859cafd5fe5bd97a3..dd3f38b56bfa5525776ee1e1925dc634c1627347 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -1612,12 +1612,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 39222a3275b0e819369de20b56f0ca418a9516ce..78717d4283fbc05bb2b55624140e1d349470d104 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -1620,12 +1620,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index f269fe7f4db97a0238f336f128ec785e00be94d6..60610f7dce6e5e94160be67b2665a35862fb28ab 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -1627,12 +1627,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 39faa4ce46ba0e475d7656a29d66d0652d902d6a..25090738e9afced9618a0dc08d28cc18620ce618 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -1517,12 +1517,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 9b90db90b05eafdc075b4f520fa82c34c89878db..9fe6a9160f7cb029627220e52ba4ac673ffd242b 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -1510,12 +1510,45 @@ //define BlinkM/CyzRgb Support //#define BLINKM -// Support for an RGB LED using 3 separate pins with optional PWM +/** + * RGB LED / LED Strip Control + * + * Enable support for an RGB LED connected to 5V digital pins, or + * an RGB Strip connected to MOSFETs controlled by digital pins. + * + * Adds the M150 command to set the LED (or LED strip) color. + * If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of + * luminance values can be set from 0 to 255. + * + * *** CAUTION *** + * LED Strips require a MOFSET Chip between PWM lines and LEDs, + * as the Arduino cannot handle the current the LEDs will require. + * Failure to follow this precaution can destroy your Arduino! + * *** CAUTION *** + * + */ //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\ diff --git a/Marlin/example_configurations/wt150/Configuration.h b/Marlin/example_configurations/wt150/Configuration.h index 5bf1ca45fb067d607c4f4f0237de7aca23d0f92b..83f517fa63288a3cf300fc70a51bf680aa22e24f 100644 --- a/Marlin/example_configurations/wt150/Configuration.h +++ b/Marlin/example_configurations/wt150/Configuration.h @@ -1521,10 +1521,27 @@ // Support for an RGB LED using 3 separate pins with optional PWM //#define RGB_LED -#if ENABLED(RGB_LED) +//#define RGBW_LED +#if ENABLED(RGB_LED) || ENABLED(RGBW_LED) #define RGB_LED_R_PIN 34 #define RGB_LED_G_PIN 43 #define RGB_LED_B_PIN 35 + #define RGB_LED_W_PIN -1 +#endif + +/** + * Printer Event LEDs + * + * During printing, the LEDs will reflect the printer status: + * + * - Gradually change from blue to violet as the heated bed gets to target temp + * - Gradually change from violet to red as the hotend gets to temperature + * - Change to white to illuminate work surface + * - Change to green once print has finished + * - Turn off after the print has finished and the user has pushed a button + */ +#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) + #define PRINTER_EVENT_LEDS #endif /*********************************************************************\