Skip to content

Commit 876e647

Browse files
authored
Merge pull request #2117 from aioue/patch-2
Update PyPortal User Interface code to support Titano
2 parents 7817031 + f414fb9 commit 876e647

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

PyPortal_User_Interface/code.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,20 @@ def set_backlight(val):
6464
board.DISPLAY.brightness = val
6565

6666
# Set the Backlight
67-
set_backlight(0.3)
67+
if board.board_id == "pyportal_titano":
68+
# 0.3 brightness does not cause the display to be visible on the Titano
69+
set_backlight(1)
70+
else:
71+
set_backlight(0.3)
6872

6973
# Touchscreen setup
7074
# ------Rotate 270:
71-
screen_width = 240
72-
screen_height = 320
75+
if board.board_id == "pyportal_titano":
76+
screen_width = 320
77+
screen_height = 480
78+
else:
79+
screen_width = 240
80+
screen_height = 320
7381
ts = adafruit_touchscreen.Touchscreen(board.TOUCH_YD, board.TOUCH_YU,
7482
board.TOUCH_XR, board.TOUCH_XL,
7583
calibration=((5200, 59000),

0 commit comments

Comments
 (0)