I'm using python to try and talk to my Arduino with pyserial. The code should wait for an input from COM5, (the arduino), and then sends a 1 and waits for the response.
import serial
connected = False
ser = serial.serial("COM5", 9600)
while not connected:
serin = ser.read()
connected = True
ser.write("1")
while ser.read() == '1':
ser.read()
ser.close()
All I get if this error message.
Traceback (most recent call last):
File "C:\Users\Patrick\Documents\Python\serial.py", line 2, in <module>
import serial
File "C:\Users\Patrick\Documents\Python\serial.py", line 10, in <module>
ser = serial.serial("COM5", 9600)
TypeError: 'module' object is not callable