@@ -146,7 +146,7 @@ class Seg14x4(HT16K33):
146
146
"""Alpha-Numeric 14-segment display.
147
147
148
148
:param I2C i2c: The I2C bus object
149
- :param address: The I2C address for the display. Can be a tuple or list for multiple displays.
149
+ :param int|list|tuple address: The I2C address(es) for the display. Can be a tuple or list for multiple displays.
150
150
:param bool auto_write: True if the display should immediately change when set. If False,
151
151
`show` must be called explicitly.
152
152
:param int chars_per_display: A number between 1-8 represesenting the number of characters
@@ -156,7 +156,7 @@ class Seg14x4(HT16K33):
156
156
def __init__ (
157
157
self ,
158
158
i2c : I2C ,
159
- address = 0x70 ,
159
+ address : Union [ int , List [ int ], Tuple [ int , ...]] = 0x70 ,
160
160
auto_write : Union [int , List [int ], Tuple [int , ...]] = True ,
161
161
chars_per_display : int = 4 ,
162
162
) -> None :
@@ -172,8 +172,7 @@ def __init__(
172
172
def print (self , value : Union [str , float ], decimal : int = 0 ) -> None :
173
173
"""Print the value to the display.
174
174
175
- :param value: The value to print
176
- :type value: str, int, or float
175
+ :param str|float value: The value to print
177
176
:param int decimal: The number of decimal places for a floating point
178
177
number if decimal is greater than zero, or the input number is an
179
178
integer if decimal is zero.
@@ -191,15 +190,15 @@ def print(self, value: Union[str, float], decimal: int = 0) -> None:
191
190
def print_hex (self , value : Union [int , str ]) -> None :
192
191
"""Print the value as a hexidecimal string to the display.
193
192
194
- :param int value: The number to print
193
+ :param int|str value: The number to print
195
194
"""
196
195
197
196
if isinstance (value , int ):
198
197
self .print ("{0:X}" .format (value ))
199
198
else :
200
199
self .print (value )
201
200
202
- def __setitem__ (self , key , value ) :
201
+ def __setitem__ (self , key : int , value : str ) -> None :
203
202
self ._put (value , key )
204
203
if self ._auto_write :
205
204
self .show ()
@@ -256,13 +255,12 @@ def _number(self, number: float, decimal: int = 0) -> str:
256
255
"""
257
256
Display a floating point or integer number on the Adafruit HT16K33 based displays
258
257
259
- Param: number - The floating point or integer number to be displayed, which must be
260
- in the range 0 (zero) to 9999 for integers and floating point or integer numbers
261
- and between 0.0 and 999.0 or 99.00 or 9.000 for floating point numbers.
262
- Param: decimal - The number of decimal places for a floating point number if decimal
263
- is greater than zero, or the input number is an integer if decimal is zero.
264
-
265
- Returns: The output text string to be displayed.
258
+ :parma float number: The floating point or integer number to be displayed, which must be
259
+ in the range 0 (zero) to 9999 for integers and floating point or integer numbers
260
+ and between 0.0 and 999.0 or 99.00 or 9.000 for floating point numbers.
261
+ :param int decimal: The number of decimal places for a floating point number if decimal
262
+ is greater than zero, or the input number is an integer if decimal is zero.
263
+ :return: The output text string to be displayed
266
264
"""
267
265
268
266
auto_write = self ._auto_write
@@ -328,7 +326,7 @@ def set_digit_raw(
328
326
329
327
:param int index: The index of the display to set
330
328
:param bitmask: A 2 byte number corresponding to the segments to set
331
- :type bitmask: int, or a list/tuple of bool
329
+ :type bitmask: int, or a list/tuple of int
332
330
"""
333
331
if not isinstance (index , int ) or not 0 <= index <= self ._chars - 1 :
334
332
raise ValueError (
@@ -490,11 +488,13 @@ class Seg7x4(_AbstractSeg7x4):
490
488
supports displaying a limited set of characters.
491
489
492
490
:param I2C i2c: The I2C bus object
493
- :param address: The I2C address for the display. Can be a tuple or list for multiple displays.
491
+ :param int|list|tuple address: The I2C address for the display. Can be a tuple or list for multiple displays.
494
492
:param bool auto_write: True if the display should immediately change when set. If False,
495
493
`show` must be called explicitly.
494
+ :param dict char_dict: An optional dictionary mapping strings to bit settings integers used
495
+ for defining how to display custom letters
496
496
:param int chars_per_display: A number between 1-8 represesenting the number of characters
497
- on each display.
497
+ on each display.
498
498
"""
499
499
500
500
def __init__ ( # pylint: disable=too-many-arguments
@@ -524,9 +524,11 @@ class BigSeg7x4(_AbstractSeg7x4):
524
524
supports displaying a limited set of characters.
525
525
526
526
:param I2C i2c: The I2C bus object
527
- :param int address: The I2C address for the display
527
+ :param int|list|tuple address: The I2C address(es) for the display
528
528
:param bool auto_write: True if the display should immediately change when set. If False,
529
529
`show` must be called explicitly.
530
+ :param dict char_dict: An optional dictionary mapping strings to bit settings integers used
531
+ for defining how to display custom letters
530
532
"""
531
533
532
534
def __init__ (
0 commit comments