Browse Source

Disable laser power when PWM goes to 0

pull/1/head
Scott Lahteine 7 years ago
parent
commit
98c1265e3b
  1. 1
      Marlin/src/gcode/control/M3-M5.cpp

1
Marlin/src/gcode/control/M3-M5.cpp

@ -103,6 +103,7 @@ void GcodeSuite::M3_M4(bool is_M3) {
const float spindle_laser_power = parser.floatval('S'); const float spindle_laser_power = parser.floatval('S');
if (spindle_laser_power == 0) { if (spindle_laser_power == 0) {
WRITE(SPINDLE_LASER_ENABLE_PIN, !SPINDLE_LASER_ENABLE_INVERT); // turn spindle off (active low) 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(); delay_for_power_down();
} }
else { else {

Loading…
Cancel
Save