Skip to content

Commit 510c33a

Browse files
committed
Update simple-program for new Turing models
1 parent a6f9c7f commit 510c33a

1 file changed

Lines changed: 8 additions & 17 deletions

File tree

simple-program.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,19 @@
4141
from library.lcd.lcd_simulated import LcdSimulated
4242
from library.log import logger
4343

44-
# Set your COM port e.g. COM3 for Windows, /dev/ttyACM0 for Linux, etc. or "AUTO" for auto-discovery
44+
# Set your COM port e.g. COM3 for Windows, /dev/ttyACM0 for Linux, etc.
45+
# Use AUTO for COM port auto-discovery (may not work on every setup) or if device is not detected as a COM port
4546
# COM_PORT = "/dev/ttyACM0"
4647
# COM_PORT = "COM5"
4748
COM_PORT = "AUTO"
4849

49-
# Display revision:
50-
# - A for Turing 3.5" and UsbPCMonitor 3.5"/5"
51-
# - B for Xuanfang 3.5" (inc. flagship)
52-
# - C for Turing 5"
53-
# - D for Kipye Qiye Smart Display 3.5"
54-
# - SIMU for simulated display (image written in screencap.png)
50+
# Display revision: see config.yaml comments for values
5551
# To identify your smart screen: https://github.com/mathoudebine/turing-smart-screen-python/wiki/Hardware-revisions
56-
REVISION = "USB_C"
52+
REVISION = "A"
5753

5854
# Display width & height in pixels for portrait orientation
5955
# /!\ Do not switch width/height here for landscape, use lcd_comm.SetOrientation below
60-
# 320x480 for 3.5" models
61-
# 480x480 for 2.1" models
62-
# 480x800 for 5" models
63-
# 480x1920 for 8.8" models
64-
WIDTH, HEIGHT = 480, 1920
56+
WIDTH, HEIGHT = 320, 480
6557

6658
assert WIDTH <= HEIGHT, "Indicate display width/height for PORTRAIT orientation: width <= height"
6759

@@ -85,7 +77,6 @@ def sighandler(signum, frame):
8577
lcd_comm = None
8678
if REVISION == "A":
8779
logger.info("Selected Hardware Revision A (Turing Smart Screen 3.5\" & UsbPCMonitor 3.5\"/5\")")
88-
# NOTE: If you have UsbPCMonitor 5" you need to change the width/height to 480x800 below
8980
lcd_comm = LcdCommRevA(com_port=COM_PORT, display_width=WIDTH, display_height=HEIGHT)
9081
elif REVISION == "B":
9182
logger.info("Selected Hardware Revision B (XuanFang screen 3.5\" version B / flagship)")
@@ -96,15 +87,15 @@ def sighandler(signum, frame):
9687
elif REVISION == "D":
9788
logger.info("Selected Hardware Revision D (Kipye Qiye Smart Display 3.5\")")
9889
lcd_comm = LcdCommRevD(com_port=COM_PORT, display_width=WIDTH, display_height=HEIGHT)
90+
elif REVISION == "TUR_USB":
91+
logger.info("Selected Hardware Revision Turing USB (newer models 4.6\"/5.2\"/8\"/8.8\" HW rev 1.x/9.2\"")
92+
lcd_comm = LcdCommTuringUSB(com_port=COM_PORT, display_width=WIDTH, display_height=HEIGHT)
9993
elif REVISION == "WEACT_A":
10094
logger.info("Selected Hardware WeAct Studio Display FS V1 3.5\"")
10195
lcd_comm = LcdCommWeActA(com_port=COM_PORT, display_width=WIDTH, display_height=HEIGHT)
10296
elif REVISION == "WEACT_B":
10397
logger.info("Selected Hardware WeAct Studio Display FS V1 0.96\"")
10498
lcd_comm = LcdCommWeActB(com_port=COM_PORT, display_width=WIDTH, display_height=HEIGHT)
105-
elif REVISION == "USB_C":
106-
logger.info("Selected Hardware Revision USB C (Turing Smart Screen 8.8\" or 9.2\")")
107-
lcd_comm = LcdCommTuringUSB(com_port=COM_PORT, display_width=WIDTH, display_height=HEIGHT)
10899
elif REVISION == "SIMU":
109100
logger.info("Selected Simulated LCD")
110101
lcd_comm = LcdSimulated(display_width=WIDTH, display_height=HEIGHT)

0 commit comments

Comments
 (0)