Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions CircuitPython_RGBMatrix/fruit.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def step(self):
if time.monotonic_ns() > self.stop_time:
self.state = BRAKING
elif self.state == BRAKING:
# More quickly lose speed when baking, down to speed 7
# More quickly lose speed when braking, down to speed 7
self.vel = max(self.vel * 85 // 100, 7)

# Advance the wheel according to the velocity, and wrap it around
Expand All @@ -72,7 +72,6 @@ def step(self):
if self.state == BRAKING and self.vel == 7 and yyy < 4:
self.pos = off * 24 * 16
self.vel = 0
yy = 0
self.state = STOPPED

# Move the displayed tiles to the correct height and make sure the
Expand All @@ -87,11 +86,11 @@ def step(self):
def kick(self, i):
self.state = RUNNING
self.vel = random.randint(256, 320)
self.stop_time = time.monotonic_ns() + 3000000000 + i * 350000000
self.stop_time = time.monotonic_ns() + 3_000_000_000 + i * 350_000_000

# Our fruit machine has 3 wheels, let's create them with a correct horizontal
# (x) offset and arbitrary vertical (y) offset.
g = displayio.Group(max_size=3)
g = displayio.Group()
wheels = []
for idx in range(3):
wheel = Wheel()
Expand Down Expand Up @@ -119,7 +118,7 @@ def all_stopped():

# Here's the main loop
while True:
# Refresh the dislpay (doing this manually ensures the wheels move
# Refresh the display (doing this manually ensures the wheels move
# together, not at different times)
display.refresh(minimum_frames_per_second=0)
if all_stopped():
Expand Down
4 changes: 2 additions & 2 deletions CircuitPython_RGBMatrix/life.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ def conway(output):
palette = displayio.Palette(2)
tg1 = displayio.TileGrid(b1, pixel_shader=palette)
tg2 = displayio.TileGrid(b2, pixel_shader=palette)
g1 = displayio.Group(max_size=3, scale=SCALE)
g1 = displayio.Group(scale=SCALE)
g1.append(tg1)
display.show(g1)
g2 = displayio.Group(max_size=3, scale=SCALE)
g2 = displayio.Group(scale=SCALE)
g2.append(tg2)

# First time, show the Conway tribute
Expand Down
7 changes: 3 additions & 4 deletions CircuitPython_RGBMatrix/scroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ def tilegrid(palette):
bitmap=terminalio.FONT.bitmap, pixel_shader=palette,
width=1, height=1, tile_width=6, tile_height=14, default_tile=32)

g = displayio.Group(max_size=2)
g = displayio.Group()

# We only use the built in font which we treat as being 7x14 pixels
linelen = (64//7)+2

# prepare the main groups
l1 = displayio.Group(max_size=linelen)
l2 = displayio.Group(max_size=linelen)
l1 = displayio.Group()
l2 = displayio.Group()
g.append(l1)
g.append(l2)
display.show(g)
Expand Down Expand Up @@ -101,7 +101,6 @@ def scroll(t, b):
l1.x = -j
l2.x = -j
display.refresh(minimum_frames_per_second=0)
#display.refresh(minimum_frames_per_second=0)

# Repeatedly scroll all the pairs of lines
while True:
Expand Down