serial_interface.py 文件源码

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

项目:sequelspeare 作者: raidancampbell 项目源码 文件源码
def __init__(self):
        existing_ports = SerialInterface.serial_ports()
        if len(existing_ports) > 1:
            print('WARN! more than one serial port is active on the computer.  Blindly using first one...')
        if len(existing_ports) is 0:
            print('ERR! no serial ports found on the computer! Exiting...')
            exit(-1)
        print('using port: ' + existing_ports[0])
        port_name = existing_ports[0]
        self.ser = serial.Serial(port=port_name, baudrate=9600, bytesize=BYTE_SIZE, parity=serial.PARITY_NONE,
                                 stopbits=STOP_BITS, write_timeout=10, timeout=10)
        self.sampler = Sampler()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号