
Python3 中实现两个进程间的串口同步读写
5星
- 浏览量: 0
- 大小:None
- 文件类型:None
简介:
本项目展示了如何在Python 3中通过两个独立进程实现串口数据的同步读写操作。采用多进程技术确保高效的数据传输与处理。
通过两个进程分别读取和写入串口,并将发送与接收的内容记录在日志文件中,当接收到字符q时程序结束并退出。
```python
import threading
import time
import serial
class SerThread:
def __init__(self, Port=0):
# 初始化串口、blog文件名称
self.my_serial = serial.Serial()
self.my_serial.port = Port
self.my_serial.baudrate = 9600
self.my_serial.timeout = 1
```
全部评论 (0)
还没有任何评论哟~


