Python Serial: How to use the read or readline function to read more than 1 character at a time

前端 未结 4 580
谎友^
谎友^ 2020-12-14 08:00

I\'m having trouble to read more than one character using my program, I can\'t seem to figure out what went wrong with my program.

import serial

ser = seria         


        
4条回答
  •  甜味超标
    2020-12-14 08:50

    I use this small method to read Arduino serial monitor with Python

    import serial
    ser = serial.Serial("COM11", 9600)
    while True:
         cc=str(ser.readline())
         print(cc[2:][:-5])
    

提交回复
热议问题