Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ESP8266 PWM range is 255 instead of 1024 #4815

Closed
TD-er opened this issue Sep 22, 2023 · 1 comment
Closed

[BUG] ESP8266 PWM range is 255 instead of 1024 #4815

TD-er opened this issue Sep 22, 2023 · 1 comment
Labels
Platform: ESP8266 ESP8266/ESP8285 based devices

Comments

@TD-er
Copy link
Member

TD-er commented Sep 22, 2023

Apparently this breaking change commit was merged "recently" (3 years ago)
esp8266/Arduino#7456

@TD-er TD-er added the Platform: ESP8266 ESP8266/ESP8285 based devices label Sep 22, 2023
@TD-er
Copy link
Member Author

TD-er commented Sep 22, 2023

Ah nope, was already fixed:

void initAnalogWrite()
{
  #if defined(ESP32)

  constexpr unsigned nrLedChannelPins = NR_ELEMENTS(ledChannelPin);

  for (uint8_t x = 0; x < nrLedChannelPins; x++) {
    ledChannelPin[x]  = -1;
    ledChannelFreq[x] = ledcSetup(x, 1000, 10); // Clear the channel
  }
  #endif // if defined(ESP32)
  #ifdef ESP8266

  // See https://github.com/esp8266/Arduino/commit/a67986915512c5304bd7c161cf0d9c65f66e0892
  analogWriteRange(1023);
  #endif // ifdef ESP8266
}

@TD-er TD-er closed this as completed Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: ESP8266 ESP8266/ESP8285 based devices
Projects
None yet
Development

No branches or pull requests

1 participant