micropython/docs/pyboard/tutorial/pass_through.rst
Daniel Campora 7ca1bd314b docs: Generate a separate docs build for each port.
Using Damien's approach where conf.py and topindex.html are
shared by all ports.
2015-06-04 23:44:35 +01:00

19 lines
440 B
ReStructuredText

Making a UART - USB pass through
================================
It's as simple as::
import pyb
import select
def pass_through(usb, uart):
usb.setinterrupt(-1)
while True:
select.select([usb, uart], [], [])
if usb.any():
uart.write(usb.read(256))
if uart.any():
usb.write(uart.read(256))
pass_through(pyb.USB_VCP(), pyb.UART(1, 9600))