<reponame>CarterWS/Summer2020
#fromhttps://github.com/micropython/micropython/blob/master/docs/pyboard/tutorial/pass_through.rst

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, timeout=0))

#fromhttps://github.com/micropython/micropython/blob/master/docs/pyboard/tutorial/pass_through.rst

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, timeout=0))
#fromhttps://github.com/micropython/micropython/blob/master/docs/pyboard/tutorial/pass_through.rst