My problem: I am trying to open 18 Serial ports/connections. I need to then loop through each of the connections to send data to each port. Right now I have the following method of storing the serial connections.
serialPortlist = []
serialPortList.append(Serial('PORTNAME', BAUDRATE, PARITY, STOPBITS, TIMEOUT))
I then repeat the second line 17 more times and append each one to the list.
When it comes time to access the ports I would have assumed I could just do a loop like the one below:
for port in serialPortList:
port.reset_input_buffer()
header = port.read(2)
When I run the above I get the error:
Error: TypeError: 'NoneType' object is not iterable.
I just want to be able to iterate through a list or array or something. If not this is going to be a super painful project.
Any ideas?