You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The doc on the web page states the same. It obv makes sense to return the actual range which might be different to the one requested. I do a workaround for now in my code: https://github.com/berndporr/alphabot/blob/main/alphabot.cpp#L9
where I just set the pwm range and then read it back. Either way the real range is really good to have as with that I can avoid rounding errors and get always the best resolution.
The text was updated successfully, but these errors were encountered:
I agree with you but if we change the API from the documentation then it could disrupt current users of the library. It looks like you have a satisfactory working method so can this issue be closed?
The API is great as it is. I'd suggest to just fix the documentation and state that the function actually returns the real range not just zero on success. If you have no plans of changing it then I can actually use the return value. :)
set_PWM_range doc states:
https://github.com/joan2937/pigpio/blob/master/pigpiod_if2.h#L595
However the underlying function in pigpio.c returns the real range:
https://github.com/joan2937/pigpio/blob/master/pigpio.c#L9080
The doc on the web page states the same. It obv makes sense to return the actual range which might be different to the one requested. I do a workaround for now in my code:
https://github.com/berndporr/alphabot/blob/main/alphabot.cpp#L9
where I just set the pwm range and then read it back. Either way the real range is really good to have as with that I can avoid rounding errors and get always the best resolution.
The text was updated successfully, but these errors were encountered: