micropython-tm1637 icon indicating copy to clipboard operation
micropython-tm1637 copied to clipboard

TM1637. tm.scroll on 6 digit display does not work correctly.

Open 4k3or3et opened this issue 3 years ago • 2 comments

Hi All,

i am having this display:

image image

My code is:

#!/usr/bin/python
import tm1637
from time import sleep

tm = tm1637.TM1637(clk=21, dio=20)

tm.brightness(0)

def swap(segs):
 length = len(segs)
 if length == 4 or length == 5:
  segs.extend(bytearray([0] * (6 - length)))
 segs[0], segs[2] = segs[2], segs[0]
 if length >= 4:
  segs[3], segs[5] = segs[5], segs[3]
 return segs

var = '1234567890'

tm.write(swap(tm.scroll(var)))

The problem is that text does not scroll correctly. It goes like that:

image

Function code:

tm.write(swap(tm.encode_string(count)))

displays fine.

Am I coding something wrong? If my code is OK , are you able to fix it?

4k3or3et avatar Apr 01 '22 06:04 4k3or3et

You're right. Scroll doesn't work as expected. I'll look into it and make a fix.

mcauser avatar Jul 03 '23 00:07 mcauser