diff --git a/.gitignore b/.gitignore index 7ee4116..65bd646 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ /__pycache__ /test/ /app/ +/main_test.py +/start_test.bat diff --git a/README.md b/README.md index e83f217..e0dd034 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ ## 使用方法 1. 打开任意P图工具, 准备一个和设备屏幕大小相同的一张图片(例如:1600x2560), 将 `./image/color_exp_panel.png` -放置到该图片圆形触摸区域的位置(或者可以参考`./image/image_monitor_edit3.png`的做法), 编辑好的图片放到脚本目录下取名 `image_monitor.png`. +放置到该图片圆形触摸区域的位置(或者可以参考`./image/image_monitor_edit3.png`的做法), 编辑好的图片放到脚本 `image` 目录下取名 `image_monitor.png`. 2. 编辑 `main.py` 脚本文件, 修改脚本内 `exp_image_dict` 变量, 将各区块对应的 R 通道颜色值改为刚P的图的对应区块颜色值(一般不用改默认就行) -3. 编辑 `main.py` 脚本文件, 修改脚本内 `COM_PORT`, `COM_BAUDRATE`, `MAX_SLOT` 三个配置 +3. 编辑 `main.py` 脚本文件, 修改脚本内 `IMAGE_PATH` `COM_PORT`, `COM_BAUDRATE`, `MAX_SLOT` 四个配置 4. 下一个 `VSPD` 虚拟串口工具, 将 `COM3` 和 `COM33` 建立转发 5. 电脑安装 ADB 调试工具, 安装路径添加到系统环境变量里面 6. 手机打开 USB 调试, 强烈建议同时使用 USB 网络共享连接电脑, 串流走 WLAN 可能不是很稳定 diff --git a/image/exp_monitor_high.png b/image/exp_monitor_high.png new file mode 100644 index 0000000..60ba093 Binary files /dev/null and b/image/exp_monitor_high.png differ diff --git a/image/image_monitor_high.png b/image/image_monitor_high.png new file mode 100644 index 0000000..ae8c598 Binary files /dev/null and b/image/image_monitor_high.png differ diff --git a/image_monitor.png b/image_monitor.png deleted file mode 100644 index 446c280..0000000 Binary files a/image_monitor.png and /dev/null differ diff --git a/main.py b/main.py index 3795dd8..4ee4d15 100644 --- a/main.py +++ b/main.py @@ -6,6 +6,8 @@ import threading import queue import serial +# 编辑好的图片路径 +IMAGE_PATH = "./image/image_monitor.png" # 串口号 COM_PORT = "COM33" # 比特率 @@ -262,7 +264,7 @@ def getevent(): print(event_error_output) -exp_image = Image.open("./image_monitor.png") +exp_image = Image.open(IMAGE_PATH) exp_image_width, exp_image_height = exp_image.size if __name__ == "__main__": diff --git a/microsecond_sleep.py b/microsecond_sleep.py deleted file mode 100644 index 9d7c693..0000000 --- a/microsecond_sleep.py +++ /dev/null @@ -1,15 +0,0 @@ -import time - - -def microsecond_sleep(sleep_time): - end_time = time.perf_counter() + (sleep_time - 1.0) / 1e6 # 1.0是时间补偿,需要根据自己PC的性能去实测 - while time.perf_counter() < end_time: - pass - - -start = time.perf_counter() -microsecond_sleep(10) # 等待10微秒 -end = time.perf_counter() -print(start) -print(end) -print("等待时间:", (end-start) * 1e6, "微秒")