Hi, I have this code to communicate to an RFID device that outputs hex values.
import serial
COMPort='COM13'
mySer=serial.Serial(COMPort, 9600, timeout=2)
try:
mySer.flushInput()
print "".join(["0x%2x " %(ord(c)) for c in list(mySer.readall)])
print msg
finally:
print 'Close'
mySer.close()
but cause error
Traceback (most recent call last):
File "C:\Python26\rfidtest.py", line 6, in <module>
print "".join(["0x%2x " %(ord(c)) for c in list(mySer.readall)])
AttributeError: 'Serial' object has no attribute 'readall'
can anybody help me what I'm missing? I'm sure I got the same code worked before.
thanks in advance,
mbox+96