-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
PWM doesn't work with frequencies below 77Hz #5
Comments
By the way, for the sake of using RC servos, it would be nice to be able to set the duty period in µs instead of percents. At 50Hz, 1% corresponds to about 7° of servo rotation, which is a pretty large granularity. With µs, we could get as accurate as the servo's dead band. |
the resolution of pwm duty is 256-deep because of SDK driver. |
In that case, I think it makes the most sense to specify it as 0-255, so there is no surprise about the granularity, and you get the best resolution possible in those circumstances. |
If you try to set the PWM frequency to anything below 77Hz (either with pwm.setup() or pwm.setclock()), then the resulting signal is the same as if the pin was in INPUT mode -- basically high all the time, with some noise.
It is maybe not an issue when you want to use the PWM for driving LEDs or motors, but RC servos usually require 50Hz signal, and you might also want to use that for generating sound using a speaker or buzzer (that's actually what I'm doing).
The text was updated successfully, but these errors were encountered: