The USBIN command returns the number of bytes received in the cnt variable.
You should use that variable for the number of bytes to be sent by USBOUT.
Otherwise, if it only receives 1 byte, and sends 3 bytes, 2 of them will be garbage characters left over in the buffer.Code:USBOut 3, buffer, cnt, outloop




Bookmarks