Skip to content

Commit

Permalink
heater: update averaged temp when heater is disabled
Browse files Browse the repository at this point in the history
averaged temp must be updated with every reading even if heater is off,
otherwise it would drift away significantly when tip heater is being switched on/off
  • Loading branch information
vortigont committed Mar 27, 2024
1 parent fa0608b commit a0ec561
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions SolderingPen_ESP32S2/heater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ void TipHeater::_runnerHndlr(){
// skip cycle if heater is disabled or tip is missing
if (!enabled || t > TEMP_NOTIP){
_t.calibrated = t;
_t.avg = t;
// set pwm to 0 if active
if (ledc_get_duty(LEDC_MODE, _ledc_channel)){
ledc_set_duty(LEDC_MODE, _ledc_channel, 0);
Expand Down

0 comments on commit a0ec561

Please sign in to comment.