Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 55 commits into
base: master
Choose a base branch
from

Conversation

4k3or3et
Copy link

@4k3or3et 4k3or3et commented Apr 1, 2022

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?

depklyon and others added 30 commits July 26, 2017 23:09
Merging the latest from mcauser's repo.
Remove useless machine dependency, adjust formatting
sleep_ms() doesn't exists, switching to sleep()
Update gif animation showing most of the example available
mdhs-science and others added 25 commits July 2, 2020 21:55
Use digitalWrite() and digitalWrite() when writing/reading to the bus
Add installation instructions to README.md
tm.dectemperature(float) shows values between -9.9 and 99.9 with the colon as decimal point and the degree character. Splitting the value could probably be done better but it works.
Suggestions followed. Added exception handling for cases where decimal point may be missing.
Added support for decimal temperature values
…_high_cpu_usage

remove endless loop from _write_byte
Change GPIO library from WiringPi to RPi.GPIO
Update requirements and version
@mcauser
Copy link
Owner

mcauser commented Jul 3, 2023

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

@mcauser
Copy link
Owner

mcauser commented Oct 20, 2024

Not sure why they decide to go non-sequential with the LEDs. Maybe it was easier to route the PCB?
I've ordered one of these LEDs and will get an example working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants