11 lines
137 B
Python
11 lines
137 B
Python
|
import serial as s
|
||
|
ser=s.Serial()
|
||
|
ser.baudrate = 9600
|
||
|
ser.port = "COM4"
|
||
|
ser.timeout=10
|
||
|
|
||
|
ser.open()
|
||
|
x=ser.readline()
|
||
|
print(x)
|
||
|
ser.close()
|