USB HID Device sampling rate

ereming's Avatar

ereming

31 Jul, 2017 01:23 PM

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

  1. Support Staff 1 Posted by Christopher Sta... on 31 Jul, 2017 01:38 PM

    Christopher Stawarz's Avatar

    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

  2. 2 Posted by ereming on 31 Jul, 2017 02:12 PM

    ereming's Avatar

    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

  3. Support Staff 3 Posted by Christopher Sta... on 31 Jul, 2017 02:31 PM

    Christopher Stawarz's Avatar

    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

  4. Support Staff 4 Posted by Christopher Sta... on 02 Aug, 2017 02:21 PM

    Christopher Stawarz's Avatar

    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.

  5. Christopher Stawarz closed this discussion on 02 Aug, 2017 02:21 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac