Skip to content

Commit 2acae14

Browse files
committed
Fix address and debug demo added
1 parent a54bd4e commit 2acae14

File tree

4 files changed

+54
-14
lines changed

4 files changed

+54
-14
lines changed

demos/all_on/.main.py.swo

12 KB
Binary file not shown.

demos/all_on/main.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
class AllOn:
2+
"""This demo turns all the segments on"""
3+
4+
demo_time = None
5+
6+
# User input is passed through input_queue
7+
# Game output is passed through output_queue
8+
# Screen updates are done through the screen object
9+
def __init__(self, input_queue, output_queue, screen):
10+
"""
11+
Constructor
12+
13+
Args:
14+
input_queue (Queue): Queue for user input
15+
output_queue (Queue): Queue for game output
16+
screen (Screen): Screen object
17+
"""
18+
# Provide the framerate in frames/seconds and the amount of time of the demo in seconds
19+
self.frame_rate = 50
20+
21+
self.input_queue = input_queue
22+
self.output_queue = output_queue
23+
self.screen = screen
24+
# init demo/game specific variables here
25+
26+
def run(self):
27+
"""Run the demo"""
28+
# Create generator here
29+
for column in range(0, self.screen.x_width):
30+
for row in range(0, self.screen.y_height):
31+
self.screen.draw_pixel(column, row, 0xf, combine=True)
32+
33+
self.screen.push()
34+
while True:
35+
yield
36+
37+
def stop(self):
38+
"""Reset the state of the demo if needed, else leave blank"""
39+
pass
40+

display/physical_screen_v2.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ def __init__(self, brightness=5):
1313

1414
self.addresses = [
1515
# First row
16-
"172.0.0.5",
17-
"172.0.0.4",
18-
"172.0.0.3",
16+
"172.16.0.5",
17+
"172.16.0.4",
18+
"172.16.0.3",
1919
# Second row
20-
"172.0.0.8",
21-
"172.0.0.7",
22-
"172.0.0.6",
20+
"172.16.0.8",
21+
"172.16.0.7",
22+
"172.16.0.6",
2323
# Third row
24-
"172.0.0.11",
25-
"172.0.0.10",
26-
"172.0.0.9",
24+
"172.16.0.11",
25+
"172.16.0.10",
26+
"172.16.0.9",
2727
# Fourth row
28-
"172.0.0.14",
29-
"172.0.0.13",
30-
"172.0.0.12",
28+
"172.16.0.14",
29+
"172.16.0.13",
30+
"172.16.0.12",
3131
]
3232
self._create_display()
3333

display/seven_seg_v2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class SevenSegment:
3030
def __init__(
3131
self,
3232
baudrate=DEFAULT_BAUDRATE,
33-
ip_address="172.0.0.3",
34-
port=1883,
33+
ip_address="172.16.0.3",
34+
port=2018,
3535
brightness=7,
3636
clear=True,
3737
):

0 commit comments

Comments
 (0)