Hi,
I get errors in serial data in my python program but when I use PuTTY I get clean data without errors. I am not sure if I am writing the serial routine properly or I am missing something that introduce errors.
I get errors in serial data in my python program but when I use PuTTY I get clean data without errors. I am not sure if I am writing the serial routine properly or I am missing something that introduce errors.
# Serial port config import serial ser = serial.Serial("COM7", 9600) # Send character 'A' to start the program ser.write(bytearray('A','ascii')) # Read line while True: bs = ser.readline() bs = bs.replace(b'\n', b' ').replace(b'\r', b' ') print(bs) # Save data in the simple text file f = open("readme.txt", "a") f.write( "\n\n") f.write(str(bs)) f.close()