Skip to content
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

segments: Add missing API for "dot" control on big 7-segments #41

Open
wants to merge 2 commits into
base: master
from

Conversation

@vdehors
Copy link

vdehors commented Oct 21, 2019

There are 4 side LEDs around the 4 7-segments on 1.2" packages of HT16k33
(https://www.adafruit.com/product/1270). This commit adds an API to control
them (set and get).

There already was setter and getter to control "ampm" dot (the one at the
top-right). This API is still working but now use the new added functions.

There are 4 side LEDs around the 4 7-segments on 1.2" packages of HT16k33
(https://www.adafruit.com/product/1270). This commit adds an API to control
them (set and get).

There already was setter and getter to control "ampm" dot (the one at the
top-right). This API is still working but now use the new added functions.
Copy link
Contributor

tannewt left a comment

Thank you for this change!

In general we avoid get/set methods because they can be implemented with properties (like ampm) or data descriptors like colon. ampm and colon already cover two of the four cases you are adding support here.

I'd recommend adding two more properties for top_left_dot and bottom_left_dot that are implemented like ampm. You can use your new get/set methods internally by adding an _ to the start of the name. The other way do do it is by using a data descriptor class for all three.

@vdehors

This comment has been minimized.

Copy link
Author

vdehors commented Oct 22, 2019

Hi tannewt,

Indeed, I didn't see the Colon class (which implemented what I needed btw). I made your changes but the "colon" property may be enough (with doc) ?

Copy link
Contributor

tannewt left a comment

One comment about two_dots_center. Good otherwise. Thanks!

""" Get side LEDs (dots)
See setindicator() for indexes
"""
bitmask = 1 << (index + 1)
return self._get_buffer(0x04) & bitmask

@property
def two_dots_center(self):

This comment has been minimized.

Copy link
@tannewt

tannewt Nov 2, 2019

Contributor

Isn't this the colon? There shouldn't be two ways to set it.

@bobdog6861

This comment has been minimized.

Copy link

bobdog6861 commented Nov 17, 2019

I would like to disable the zero blanking of first and second digits, so that I can display the zeros. I cannot seem to figure out where in the driver it is making that decision. Is it in _put, in ht16k33.py ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.