mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 08:28:12 +01:00
Fix SlowPWM output switch at the end of period (#2984)
This commit is contained in:
parent
d8e719d1c4
commit
df929f9445
1 changed files with 1 additions and 1 deletions
|
@ -15,7 +15,7 @@ void SlowPWMOutput::loop() {
|
||||||
uint32_t now = millis();
|
uint32_t now = millis();
|
||||||
float scaled_state = this->state_ * this->period_;
|
float scaled_state = this->state_ * this->period_;
|
||||||
|
|
||||||
if (now - this->period_start_time_ > this->period_) {
|
if (now - this->period_start_time_ >= this->period_) {
|
||||||
ESP_LOGVV(TAG, "End of period. State: %f, Scaled state: %f", this->state_, scaled_state);
|
ESP_LOGVV(TAG, "End of period. State: %f, Scaled state: %f", this->state_, scaled_state);
|
||||||
this->period_start_time_ += this->period_;
|
this->period_start_time_ += this->period_;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue