open_bci_v3.py 文件源码

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

项目:ECG_Respiratory_Monitor 作者: gabrielibagon 项目源码 文件源码
def find_port(self):
    try:
      temp_port_list = serial.tools.list_ports.comports()
    except OSError:
      raise OSError('Serial port not found! Try entering your port manually.')
    ports = [i[0] for i in temp_port_list][::-1]

    openbci_port = ''
    for port in ports:
      try:
        s = serial.Serial(port= port, baudrate = self.baudrate, timeout=self.timeout)
        s.write(b'v')
        openbci_serial = self.openbci_id(s)
        s.close()
        if openbci_serial:
          openbci_port = port;
      except (OSError, serial.SerialException):
        pass
    if openbci_port == '':
      raise OSError('Cannot find OpenBCI port')
    else:
      return openbci_port
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号