Skip to content

MatrixPortal : solution to refresh the clock every second #83

@kabcasa

Description

@kabcasa

I have a clock that needs to be updated every second on a first line and a second line that displays scrolling text.
currently the clock is only updated at the end of line 2 scrolling.
I am looking for a solution to refresh the clock every second independently of line 2

i have set the matrix :
<

# Matrix setup
print('Matrix Setup')
matrixportal = MatrixPortal(
    url = URL,
    json_path=FORECAST_TYPE,
    status_neopixel = board.NEOPIXEL,
    debug=True,
)

print('Text Setup')
matrixportal.add_text(
    text_font=terminalio.FONT,
    text_position=(10, 5),
    text_color=0xFF8080
)
matrixportal.add_text(
    text_font=terminalio.FONT,
    text_position=(0, 20),
    text_color=0x3ABCBC,
    scrolling=True
)

and for display :
<

matrixportal.set_text(curtime, 0)
matrixportal.set_text(next_station_in, 1)
matrixportal.scroll_text(SCROLL_DELAY)
time.sleep(0.03) 

I could get the clock update every second when using matrix.scroll() but get an issue
File "adafruit_matrixportal/matrixportal.py", line 231, in scroll
AttributeError: 'NoneType' object has no attribute 'x'

<
```
matrixportal.set_text(curtime, 0)
matrixportal.scroll()
matrixportal.set_text(next_station_in, 1)
matrixportal.scroll_text(SCROLL_DELAY)
time.sleep(0.03)

>


Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions