Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

calculate pwm resolution #3

Closed
mrdevis opened this issue May 15, 2022 · 2 comments
Closed

calculate pwm resolution #3

mrdevis opened this issue May 15, 2022 · 2 comments

Comments

@mrdevis
Copy link

mrdevis commented May 15, 2022

Hi,
and thanks for the work you have done on this!
I have a small question as I am a little stuck here.
If I program a PWM frequency of say 100Hz, how would I be able to calculate the resolution of the pulse width?
cheers

@khoih-prog
Copy link
Owner

The resolution is not determined and is not fixed value as this is hybrid ISR-based, not purely hardware-based PWM.
It depends on many factors such as settings, how many PWM channels you're using, ESP8266 speed, etc.

But the resolution can be guessed around ms, and can be OK with slow PWM, which is the purpose of this library.

It's easier for you to measure the resolution, if necessary for some purpose, by writing extra code to measure. Treat this as an exercise for you.

Good Luck,

@mrdevis
Copy link
Author

mrdevis commented May 18, 2022 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants