USB HID Device sampling rate

Hi Chris,

Is the sampling rate adjustable for USB HID Devices? What is the highest sampling rate possible? I don’t see any mention of sampling rate in the documentation:

https://mworks.github.io/documentation/0.7/components/usb_hid_device.html#usb-hid-device

Thanks,
Evan

Hi Evan,

There is no sampling rate for USB HID devices. MWorks registers its interest in specific inputs with the OS, and the OS notifies it when new values are available.

Chris

Hi Chris,

It looks to me like MWorks is registering key presses at 8 ms intervals. Do
you mind testing to confirm this, and also that it’s an OS-level limitation?

Thanks,
Evan

Hi Evan,

It looks to me like MWorks is registering key presses at 8 ms intervals. Do you mind testing to confirm this, and also that it’s an OS-level limitation?

I don’t think I’m seeing that, but I’m not sure I’m computing the same numbers as you. Can you send me the MATLAB script you used to come to that conclusion?

Thanks,
Chris

To close this out: I did eventually see the same 8ms intervals as Evan. Some online material (example) suggests that USB keyboards poll their inputs at 125Hz, which would explain the timing Evan observed. Evan investigated whether it’s possible to change the polling rate in macOS, but he didn’t find any useful information.