I am trying to use serial port but I have no sucess with the simple program below. Somebody can help me? I run the script the result is:
TypeError: 'module' object is not callable
I change de serial to Serial and I put the b => ser.write(b,'A)
I dont know a answer to solve it
import time
import serial
ser = serial.Serial(
port='/dev/ttyUSB0',
baudrate = 9600,
parity=0,
stopbits=1,
bytesize=8,
timeout=1
)
while 1:
ser.write(b'A')
x=ser.readline()
print (x)
time.sleep(1)