-
Notifications
You must be signed in to change notification settings - Fork 11
Coerce led_current to be between 4-258mA. #4
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
Conversation
Signed-off-by: Dave Langstaff <dpl@aber.ac.uk>
Signed-off-by: DaveLangstaff <dpl@aber.ac.uk>
Apologies - got min and max sawpped, ok and tested better now. |
adafruit_as7341.py
Outdated
@@ -616,7 +615,9 @@ def led_current(self): | |||
@led_current.setter | |||
@_low_bank | |||
def led_current(self, led_curent): | |||
new_current = int((led_curent - 4) / 2) | |||
"""coerce led_curent to be between 4 & 258, then calculate value | |||
to be put into register on chip""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment will not be rendered in the documentation because only the docstring for the getter/@property
is rendered. That said, I'm OK with leaving it as a explanation of the code below it. It could also be a comment.
Please edit the setter docstring to mention the range of valid values, and to add something like "invalid values will be rounded to the closest valid number". No need to get overly specific. People who care about the nitty gritty details can read the source ;)
Please keep in mind that we try to talk about properties as nouns and not verbs. led_current
doesn't do something, it is something. Apologies if this sounds a bit pedantic, but we try our best to remain consistent in style.
For more info you can see the design guide here:
https://circuitpython.readthedocs.io/en/latest/docs/design_guide.html
@@ -11,7 +11,7 @@ | |||
|
|||
* Author(s): Bryan Siepert | |||
|
|||
Implementation Notes | |||
Implementation NotesF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix this typo
Closing. Fixed with #9. |
🤦 thanks. must have hit the wrong button. |
Signed-off-by: Dave Langstaff dpl@aber.ac.uk