How can I automatically detect and log changes to a USB joystick's position connected via vrjoystick?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a USB joystick that I would like to record the position of at a high frequency in MATLAB 2017a.
I understand that I can get the position of the joystick (i.e., axes) using:
joy = vrjoystick(1);
[axes,buttons,povs] = read(joy);
I am currently using a timer callback to call this read function every 0.05 sec. However, the timer often does not achieve the appropriate frequency and sometimes 1 or more seconds will pass without the timer completing. I thus lose some data this way. Is there a way to improve the timer or to more efficiently query the position of the joystick? Perhaps there's a way to detect changes to the joystick position and write these directly to a file?
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!