Skip to content

Commit

Permalink
Fix PWM issue of esp8266 device when duty is 0 (#2684)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ncerzzk committed Apr 27, 2024
1 parent d731fc4 commit 43b97c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/PWM/PWM_ESP8266.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ void PWMController::setMicroseconds(pwm_channel_t channel, uint16_t microseconds
if (microseconds == 0 || microseconds==refreshInterval[channel])
{
stopWaveform8266(pin);
digitalWrite(pin, microseconds == 0 ? HIGH : LOW);
digitalWrite(pin, microseconds == 0 ? LOW : HIGH);
return;
}
startWaveform8266(pin, microseconds, refreshInterval[channel] - microseconds);
}

#endif
#endif

0 comments on commit 43b97c0

Please sign in to comment.