@@ -160,6 +160,8 @@ def print(self, value):
160
160
161
161
def __setitem__ (self , key , value ):
162
162
self ._put (value , key )
163
+ if self ._auto_write :
164
+ self .show ()
163
165
164
166
def scroll (self , count = 1 ):
165
167
"""Scroll the display by specified number of places."""
@@ -182,8 +184,6 @@ def _put(self, char, index=0):
182
184
character = ord (char ) * 2 - 64
183
185
self ._set_buffer (index * 2 , CHARS [1 + character ])
184
186
self ._set_buffer (index * 2 + 1 , CHARS [character ])
185
- if self ._auto_write :
186
- self .show ()
187
187
188
188
def _push (self , char ):
189
189
"""Scroll the display and add a character at the end."""
@@ -199,6 +199,8 @@ def _text(self, text):
199
199
200
200
def _number (self , number ):
201
201
"""Display the specified decimal number."""
202
+ auto_write = self ._auto_write
203
+ self ._auto_write = False
202
204
string = "{}" .format (number )
203
205
if len (string ) > 4 :
204
206
if string .find ('.' ) > 4 :
@@ -208,6 +210,7 @@ def _number(self, number):
208
210
if '.' in string :
209
211
places += 1
210
212
self ._text (string [:places ])
213
+ self ._auto_write = auto_write
211
214
212
215
class Seg7x4 (Seg14x4 ):
213
216
"""Numeric 7-segment display. It has the same methods as the alphanumeric display, but only
@@ -257,8 +260,6 @@ def _put(self, char, index=0):
257
260
else :
258
261
return
259
262
self ._set_buffer (index , NUMBERS [character ])
260
- if self ._auto_write :
261
- self .show ()
262
263
263
264
class BigSeg7x4 (Seg7x4 ):
264
265
"""Numeric 7-segment display. It has the same methods as the alphanumeric display, but only
0 commit comments