-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!usr/bin/env python | ||
|
||
import time | ||
import argparse | ||
|
||
from luma.led_matrix.device import max7219 | ||
from luma.core.interface.serial import spi, noop | ||
from luma.core.render import canvas | ||
from luma.core.legacy import text | ||
|
||
print('Press Ctrl-C to quit...') | ||
|
||
serial = spi(port=0, device=0, gpio=noop()) | ||
device = max7219(serial, cascaded=5, block_orientation=0) | ||
|
||
currentLoop = 0 | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description='matrix_demo arguments', | ||
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | ||
|
||
parser.add_argument('--cascaded', '-n', type=int, default=5, help='Number of cascaded MAX7219 LED matrices') | ||
parser.add_argument('--block-orientation', type=int, default=0, choices=[0, 90, -90], help='Corrects block orientation when wired vertically') | ||
|
||
args = parser.parse_args() | ||
|
||
while True: | ||
|
||
currentLoop = currentLoop + 1 | ||
|
||
Tv = str(currentLoop) | ||
Tv = Tv.rjust(5, " ") | ||
|
||
with canvas(device) as draw: | ||
text(draw, (0, 0), Tv, fill="white") | ||
|
||
print(Tv) | ||
time.sleep(1) | ||
|
||
if currentLoop >= 99999: | ||
currentLoop = 0 |
15451bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rm-hull is this commit intended?
15451bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes-ish: it gives us a baseline to test with while investigating #108. I suppose it can be deleted when/if we get to the root cause
15451bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can move it to a 'scripts' or 'contrib' folder.
15451bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or at least a docstring.
15451bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, contrib sounds good