From 802ae73b137d401f957587e8b1b5b174480cdc44 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 11 Nov 2017 21:56:35 -0600 Subject: [PATCH] Turn off laser power pin when PWM goes to 0 --- Marlin/Marlin_main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index cade22fdee..193e50356d 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6449,6 +6449,7 @@ inline void gcode_G92() { const float spindle_laser_power = parser.floatval('S'); if (spindle_laser_power == 0) { WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); // turn spindle off (active low) + analogWrite(SPINDLE_LASER_PWM_PIN, SPINDLE_LASER_PWM_INVERT ? 255 : 0); // only write low byte delay_for_power_down(); } else {