Skip to content

Add ability to use custom characters for 7-segment display #96

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

Merged
merged 11 commits into from
Feb 5, 2022
Prev Previous commit
Next Next commit
Reformatted per pre-commit
  • Loading branch information
tekktrik committed Jan 7, 2022
commit d6cd31ee45ed427e18c7b3c0ef06f55fa07dcbbf
16 changes: 14 additions & 2 deletions adafruit_ht16k33/segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,13 @@ class Seg7x4(Seg14x4):

POSITIONS = (0, 2, 6, 8) # The positions of characters.

def __init__(self, i2c: I2C, address: int = 0x70, auto_write: bool = True, char_dict: Optional[Dict[str, int]] = None):
def __init__(
self,
i2c: I2C,
address: int = 0x70,
auto_write: bool = True,
char_dict: Optional[Dict[str, int]] = None,
):
super().__init__(i2c, address, auto_write)
# Use colon for controling two-dots indicator at the center (index 0)
self._colon = Colon(self)
Expand Down Expand Up @@ -404,7 +410,13 @@ class BigSeg7x4(Seg7x4):
"""Numeric 7-segment display. It has the same methods as the alphanumeric display, but only
supports displaying a limited set of characters."""

def __init__(self, i2c: I2C, address: int = 0x70, auto_write: bool = True, char_dict: Optional[Dict[str, int]] = None):
def __init__(
self,
i2c: I2C,
address: int = 0x70,
auto_write: bool = True,
char_dict: Optional[Dict[str, int]] = None,
):
super().__init__(i2c, address, auto_write)
# Use colon for controling two-dots indicator at the center (index 0)
# or the two-dots indicators at the left (index 1)
Expand Down