# OpenMV Cam H7 as a Class compliant USB device

**URL:** <https://forums.openmv.io/t/openmv-cam-h7-as-a-class-compliant-usb-device/1958>\
**Category:** OpenMV Boards\
**Created:** [October 11, 2020, 6:26am UTC](https://forums.openmv.io/t/openmv-cam-h7-as-a-class-compliant-usb-device/1958 "2020-10-11T06:26:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AUMO](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@AUMO](https://forums.openmv.io/u/AUMO)\
**Post date:** [October 11, 2020, 6:26am UTC](https://forums.openmv.io/t/openmv-cam-h7-as-a-class-compliant-usb-device/1958/1 "2020-10-11T06:26:07Z")

</div>

I would like to build a small low latency device that captures video (NIR at a short distance of 2cm-8cm) with a high speed image sensor (400fps, QQQVGA ROI), detects simple objects like spots, and passes on the coordinates via USB (HID) to a computer. Is it possible to program the OpenMV Cam H7 to act like a class compliant USB device (USB gadget)?

---

<div class="post-metadata">

**Author:** ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)\
**Post date:** [October 11, 2020, 3:44pm UTC](https://forums.openmv.io/t/openmv-cam-h7-as-a-class-compliant-usb-device/1958/2 "2020-10-11T15:44:14Z")

</div>

It’s possible to program the camera with the UVC firmware, but USB full speed is not fast enough to stream anywhere near 400FPS.

---

<div class="post-metadata">

**Author:** ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)\
**Post date:** [October 11, 2020, 6:28pm UTC](https://forums.openmv.io/t/openmv-cam-h7-as-a-class-compliant-usb-device/1958/3 "2020-10-11T18:28:56Z")

</div>

I see you want to use the camera as HID, yes it’s possible and there’s an example in board control → usb\_hid.py please read and follow the comments in the script.

---

<div class="post-metadata">

**Author:** ![AUMO](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@AUMO](https://forums.openmv.io/u/AUMO)\
**Post date:** [October 12, 2020, 4:06am UTC](https://forums.openmv.io/t/openmv-cam-h7-as-a-class-compliant-usb-device/1958/4 "2020-10-12T04:06:54Z")

</div>

Thank you for your fast answer. Yes, USB throughput should not be an issue as I only want to send at most 10\*400=4000 numbers per second. Specifically I would like the device to act as a class compliant MIDI device. Would it be possible to achieve this, e.g. by setting the hid keyword parameter (subclass, protocol, max packet length, polling interval, report descriptor) in the pyb.usb\_mode function?

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [October 13, 2020, 1:45am UTC](https://forums.openmv.io/t/openmv-cam-h7-as-a-class-compliant-usb-device/1958/5 "2020-10-13T01:45:48Z")

</div>

You’re kinda on your own here.

It’s technically possible. But, you should get ready to do firmware debugging.
