I am trying a very simple test code
- Code: Select all
ser = serial.Serial('/dev/ttyUSB0', 9600)
count = 0
msg='yyyy' #just test data string
print ser.portstr #This prints the correct data
while (count < 5):
print ser.write(msg) #this outputs data from serial port as expected, but incorrect data.
count = count + 1
""" This only transmits the number of char's in message ??? """
I know this is not a really good example for testing but it does seem to work as far as outputing char's .
It seems to only output the number of char's in the string. If I change the length of the string, the data
output will still output the number of char's.
The following is the output when the code is executing. I am using IDEL.
Python 2.7.3 (default, Apr 10 2013, 06:20:15)
[GCC 4.6.3] on linux2
Type "copyright", "credits" or "license()" for more information.
==== No Subprocess ====