This is the documentation for the latest development branch of MicroPython and may refer to features that are not available in released versions.

If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

pyb.USB_HID

Classes

USB_HID

Create a new USB_HID object.

Module Contents

class pyb.USB_HID.USB_HID

Create a new USB_HID object.

recv(data, *, timeout=5000) int

Receive data on the bus:

  • data can be an integer, which is the number of bytes to receive, or a mutable buffer, which will be filled with received bytes.

  • timeout is the timeout in milliseconds to wait for the receive.

Return value: if data is an integer then a new buffer of the bytes received, otherwise the number of bytes read into data is returned.

send(data) None

Send data over the USB HID interface:

  • data is the data to send (a tuple/list of integers, or a bytearray).