File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,9 @@ def show_splash(self):
162
162
"""
163
163
if self .debug :
164
164
return
165
+ glyphs = b'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-!,. "\' ?!'
166
+ self .arial16 .load_glyphs (glyphs )
167
+ self .arial12 .load_glyphs (glyphs )
165
168
with open ('blinka-pyloton.bmp' , 'rb' ) as bitmap_file :
166
169
bitmap1 = displayio .OnDiskBitmap (bitmap_file )
167
170
@@ -383,11 +386,9 @@ def read_s_and_c(self):
383
386
cadence = self ._compute_cadence (values , cadence )
384
387
385
388
if speed :
386
- if len (str (speed )) > 8 :
387
- speed = str (speed )[:8 ]
389
+ speed = str (speed )[:8 ]
388
390
if cadence :
389
- if len (str (cadence )) > 8 :
390
- cadence = str (cadence )[:8 ]
391
+ cadence = str (cadence )[:8 ]
391
392
return speed , cadence
392
393
393
394
@@ -402,8 +403,7 @@ def read_heart(self):
402
403
heart = measurement .heart_rate
403
404
self ._previous_heart = measurement .heart_rate
404
405
if heart :
405
- if len (str (heart )) > 4 :
406
- heart = str (heart )[:4 ]
406
+ heart = str (heart )[:4 ]
407
407
return heart
408
408
409
409
@@ -425,8 +425,7 @@ def read_ams(self):
425
425
data = None
426
426
427
427
if data :
428
- if len (data ) > 20 :
429
- data = data [:20 ]
428
+ data = data [:16 ] + (data [16 :] and '..' )
430
429
return data
431
430
432
431
You can’t perform that action at this time.
0 commit comments