The last couple of weeks have been drama packed, kids. Freya is stretching her fledgling TS-4200 wings trying to connect to a PIC chip, but this seems to be too much for her. Or rather her flailing programmer. Thus far, the Python code looks like this:
import serial
import time
ser = serial.Serial(port=0, baudrate=9600, timeout=30)
#ser.close()
ser.open()
#ser = serial.Serial(port=0, baudrate=9600, timeout=4)
print ser.portstr
#c = ”
#line = ”
for i in range(10):
#ser.open()
c = ”
line = ”
#ser.open()
ser.write(“Q”)
print ‘sent q’
while c != ‘\n’:
c = ser.read()
if c == ”:
c = ser.read()
line += c
#ser.close()
print line
time.sleep(2)
ser.close()
##print line
#ser.close()
(with better indentation and coloring.) The results are mysteriously varied; the goal is to get 10 strings with differing values, and the result is not that. Somethines we get 5 or 6 such strings before it times out, most times we get no strings at all with a what seems to be a serial port confusion error (like it was previously opened, was never opened, etc), and otherwise we get some middling combination. The struggle shall be continued later on!