When you set PWM on a pin to a given value and then WRITE a 0 to it, the PWM timer does not stop. Set the PWM to 0 as well to prevent hotend meltdowns.
This commit is contained in:
parent
b3280f5adc
commit
96291e27a8
1 changed files with 2 additions and 0 deletions
|
|
@ -1421,6 +1421,7 @@ void manage_heater()
|
|||
if(watch_raw + 1 >= current_raw){
|
||||
target_raw = 0;
|
||||
WRITE(HEATER_0_PIN,LOW);
|
||||
analogWrite(HEATER_0_PIN, 0);
|
||||
#if LED_PIN>-1
|
||||
WRITE(LED_PIN,LOW);
|
||||
#endif
|
||||
|
|
@ -1452,6 +1453,7 @@ void manage_heater()
|
|||
if(current_raw >= target_raw)
|
||||
{
|
||||
WRITE(HEATER_0_PIN,LOW);
|
||||
analogWrite(HEATER_0_PIN, 0);
|
||||
#if LED_PIN>-1
|
||||
WRITE(LED_PIN,LOW);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue