Skip to content

Commit 868b343

Browse files
author
Melissa LeBlanc-Williams
committed
Fixed flicker for printing numbers
1 parent b7f233e commit 868b343

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

adafruit_ht16k33/segments.py

100644100755
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ def _text(self, text):
199199

200200
def _number(self, number):
201201
"""Display the specified decimal number."""
202+
auto_write = self._auto_write
203+
self._auto_write = False
202204
string = "{}".format(number)
203205
if len(string) > 4:
204206
if string.find('.') > 4:
@@ -208,6 +210,7 @@ def _number(self, number):
208210
if '.' in string:
209211
places += 1
210212
self._text(string[:places])
213+
self._auto_write = auto_write
211214

212215
class Seg7x4(Seg14x4):
213216
"""Numeric 7-segment display. It has the same methods as the alphanumeric display, but only
@@ -306,4 +309,4 @@ def __setitem__(self, key, value):
306309
def __getitem__(self, key):
307310
if key > self._num_of_colons - 1:
308311
raise ValueError("Trying to access a non-existent colon.")
309-
return bool(self._disp._get_buffer(0x04) & self.MASKS[key])
312+
return bool(self._disp._get_buffer(0x04) & self.MASKS[key])

0 commit comments

Comments
 (0)