Seriový port

Jak na seriový port v pythonu

30. 9. 2018

Nainstalovat (http://pyserial.sourceforge.net/)

From <http://www.py.cz/PySerial>

from serial import *
import time

com = Serial(2)
print(com.name)
com.write("r".encode())
time.sleep(1)
print("reading")
rx = com.read()
com.close
print(rx)

FTDI
nainstalovat pylibftdi
http://pylibftdi.readthedocs.org/…ckstart.html
$ pip install pylibftdi

Connect the FTDI device to a free USB port.
Run the list_devi­ces example to enumerate connected FTDI devices: $ python -m pylibftdi.examples.list_devices