I'm writing a program that is supposed to communicate with an Arduino-unit using the serial-object. Within the init-method of a class this piece of code can be found:
try:
self.rotor = serial.Serial(port = "COM22", baudrate=115200, timeout = 0.1, writeTimeout = 1)
except serial.SerialException, e:
print "Error when connecting to collimator: ", e
When I run it I get this error message:
SerialException: could not open port 'COM1': WindowsError(2, 'The system cannot find the file specified.')
I asked the computer to open COM22, and it responds that it cannot open COM1. What's that about? The Arduino-unit is plugged into COM22.
I have another program that I haven't written myself, but which utilizes the same class library. This program works, but I don't understand how. Is there some sort of initialization of the serial-object that I have missed to do?