I am trying to use the serial port on the Raspberry but when I run the example below I have the message:
TypeError: 'module' object is not callable
import time
import serial
ser = serial.serial(
port='/dev/ttyUSB0',
baudrate = 9600,
parity=0,
stopbits=1,
bytesize=8,
timeout=1
)
while 1:
ser.write('A')
x=ser.readline()
print (x)
time.sleep(1)