-
Notifications
You must be signed in to change notification settings - Fork 65
duty_cycle getter doesn't return what setter was given #52
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
Comments
@tannewt Looks like this was in the original commit for the library, curious if you know or remember why the getter and setter would be different? |
I don't remember. Sorry! It would make more sense to read the same value back. |
I'll try, but I'm puzzled about why the |
Actually I got that wrong - if a duty cycle of zero is requested, then ...HOWEVER, the datasheet says, "The LEDn_ON and LEDn_OFF count registers should never be programmed with the same values." LEDn_OFF should be set to 0x1000 for fully off. I'll try to fix it according to the datasheet instructions. |
I'm a bit rusty with git but I think I've just submitted a PR for this. |
Hi, why does the setter have
value + 1
in line 91?:value = (value + 1) >> 4
There isn't a corresponding adjustment in the getter, so for example if I set duty_cycle to 0x7fff and then read it back I get 0x8000.
Thanks!
Rob.
The text was updated successfully, but these errors were encountered: