Skip to content

Commit cddc68e

Browse files
committed
Merge branch 'master' of github.com:python-ugame/circuitpython-stage
2 parents 1e4d011 + 5669083 commit cddc68e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pybadge/ugame.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import digitalio
88
import gamepadshift
99
import stage
10+
import displayio
11+
import busio
1012

1113

1214
K_X = 0x02
@@ -18,8 +20,18 @@
1820
K_START = 0x04
1921
K_SECLECT = 0x08
2022

23+
# re-initialize the display for correct rotation and RGB mode
24+
displayio.release_displays()
25+
_tft_spi = busio.SPI(clock=board.TFT_SCK, MOSI=board.TFT_MOSI)
26+
_tft_spi.try_lock()
27+
_tft_spi.configure(baudrate=24000000)
28+
_tft_spi.unlock()
29+
_fourwire = displayio.FourWire(_tft_spi, command=board.TFT_DC,
30+
chip_select=board.TFT_CS)
31+
display = displayio.Display(_fourwire, b'\x36\x01\xa8', width=160, height=128,
32+
rotation=0, backlight_pin=board.TFT_LITE)
33+
display.auto_brightness = True
2134

22-
display = board.DISPLAY
2335
buttons = gamepadshift.GamePadShift(
2436
digitalio.DigitalInOut(board.BUTTON_OUT),
2537
digitalio.DigitalInOut(board.BUTTON_CLOCK),

0 commit comments

Comments
 (0)