There does not appear to be a problem with the out array. It could be that
Serial.list()
is returning a zero length array so that [0] will be out of bounds. Try printing
Serial.list.length
if it shows zero then it has not found a serial port
Serial.list()
is returning a zero length array so that [0] will be out of bounds. Try printing
Serial.list.length
if it shows zero then it has not found a serial port