Skip to content

Commit 5be2db0

Browse files
authored
Update ugame.py
1 parent 6afb677 commit 5be2db0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

feather_m4_minitft_featherwing/ugame.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
spi = board.SPI()
5353
ss = Seesaw(i2c, 0x5E)
5454
backlight = PWMOut(ss, 5)
55-
backlight.duty_cycle = int(255 * min(max(1 - 0.1, 0.0), 1.0))
55+
brightness = 1 # 0 full on, 1 full off, 0.5 half
56+
backlight.duty_cycle = int(255 * min(max(1 - brightness, 0.0), 1.0))
5657
ss.pin_mode_bulk(button_mask, ss.INPUT_PULLUP)
5758
displayio.release_displays()
5859
while not spi.try_lock():
@@ -62,10 +63,12 @@
6263
ss.pin_mode(8, ss.OUTPUT)
6364
ss.digital_write(8, True) # Reset the Display via Seesaw
6465
display_bus = displayio.FourWire(spi,
65-
command=board.D10,
66-
chip_select=board.D9)
66+
command=board.D6,
67+
chip_select=board.D5)
6768
display = displayio.Display(display_bus, _INIT_SEQUENCE, width=160, height=80, rowstart=24)
6869
ss.pin_mode_bulk(button_mask, ss.INPUT_PULLUP)
70+
# clean up some RAM
71+
del _INIT_SEQUENCE, brightness
6972

7073
def buttons():
7174
"""

0 commit comments

Comments
 (0)