adafruit / adafruit/Adafruit_CircuitPython_MatrixPortal

MatrixPortal : solution to refresh the clock every second

Open
#83 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
36
Forks
23
PR merge metrics
No merged PRs in 30d

Description

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)
```
>

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the MatrixPortal setup and display calls in the issue, then inspect adafruit_matrixportal/matrixportal.py around line 231 where scroll raises the NoneType error. Reproduce the independent clock and scrolling-text behavior on the MatrixPortal hardware and trace why scroll fails. Done means the clock refreshes independently while scrolling text continues without the reported exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.