From anonymous, 3 Months ago, written in Python.
Embed
  1. ser = QSerialPort()
  2. ser.setPortName(...)
  3. ser.open(QIODevice.Read)
  4. ser.setBaudRate(...)
  5. # set up other stuff
  6. timer = QTimer()
  7. timer.setInterval(1000)
  8. timer.timeout.connect(lambda: print(ser.readLine()))