Skip to content

Commit

Permalink
Merge pull request #11786 from barbudor/esp32_pwm_full
Browse files Browse the repository at this point in the history
Demo of PWM 100% problem on ESP32 (for discussion)
  • Loading branch information
arendst committed Apr 20, 2021
2 parents 2db9391 + 785d8a7 commit 33dcbb4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ inline void analogAttach(uint32_t pin, uint32_t channel) {
inline void analogWrite(uint8_t pin, int val)
{
uint32_t channel = _analog_pin2chan(pin);
if ( val >> (_pwm_bit_num-1) ) ++val;
ledcWrite(channel + PWM_CHANNEL_OFFSET, val);
// Serial.printf("write %d - %d\n",channel,val);
}
Expand Down

0 comments on commit 33dcbb4

Please sign in to comment.