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

Fix servo not working on ESP32-S2 #320

Merged
merged 4 commits into from
Sep 12, 2022
Merged

Fix servo not working on ESP32-S2 #320

merged 4 commits into from
Sep 12, 2022

Conversation

brentru
Copy link
Member

@brentru brentru commented Sep 12, 2022

Addresses #313

  • Drops LEDC timer resolution for a servo to 12 bits,
  • Noting, while ESP32x can go up to a 16-bit timer width, ESP32-S2 does not work properly at this resolution. So, for the purposes of keeping this library compatible with multiple ESP32x platforms, the timer width has been scaled down to 12 bits and the calculation for the duty cycle was adjusted accordingly.
  • Adds optional resolution parameter to attachPin() call in LEDC manager.
  • Removes hardcoding within the writeMicroseconds count formula to accept a variable (#define'd) timer resolution.

Tested on:
Adafruit ESP32 Feather V2
Adafruit QT Py ESP32-S2

@brentru brentru merged commit 3596f6d into adafruit:main Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant