Jan-18-2018, 12:05 PM
Hello, I'm new in python. I use an Arduino to sensing, and I wrote a small python program to read the data from usb. I use Python 3.5. The program is this:
I get:
flushInput()
NameError: name 'flushInput' is not defined
#!/usr/bin/env python import serial,time ser = serial.Serial( port='COM8', baudrate=115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE ) line = ser.readline(); while line: print(line), # flushInput() #ser.close()When I execute it, I get only the first sentence repeatedly of what Arduino sends, not the rest of of the calculations. So I suppose I should flush the Serial buffer. When I flush the serial with the command flushInput() as I read from here: http://pyserial.readthedocs.io/en/latest...l_api.html
I get:
flushInput()
NameError: name 'flushInput' is not defined