Feb-07-2019, 05:58 AM
Hi,
I am new to python. I was facing an issue while using serial communication. I am sending 1 byte data from a device to the raspberry pi board using serial to USB converter. The error I was getting is given below
Attribute error: 'Serial' object has no attribute 'inwaiting'
The program is given below,
import serial
ser = serial.Serial(port='dev/ttyUSB0',baudrate=9600)
try:
data = ser.read()
response=ser.read(ser.inwaiting)
print(data)
finally:
ser.close()
Please reply as soon as possible
Thank you,
Alphy
I am new to python. I was facing an issue while using serial communication. I am sending 1 byte data from a device to the raspberry pi board using serial to USB converter. The error I was getting is given below
Attribute error: 'Serial' object has no attribute 'inwaiting'
The program is given below,
import serial
ser = serial.Serial(port='dev/ttyUSB0',baudrate=9600)
try:
data = ser.read()
response=ser.read(ser.inwaiting)
print(data)
finally:
ser.close()
Please reply as soon as possible
Thank you,
Alphy