grid.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:grid-control 作者: akej74 项目源码 文件源码
def setup_serial(ser, port, lock):
    """Setup all parameters for the serial communication"""
    try:
        with lock:
            ser.baudrate = 4800
            ser.port = port
            ser.bytesize = serial.EIGHTBITS
            ser.stopbits = serial.STOPBITS_ONE
            ser.parity = serial.PARITY_NONE
            ser.timeout = 0.1  # Read timeout in seconds
            ser.write_timeout = 0.1  # Write timeout in seconds
    except Exception as e:
        helper.show_error("Problem initializing serial port " + port + ".\n\n"
                          "Exception:\n" + str(e) + "\n\n"
                          "The application will now exit.")
        sys.exit(0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号