Which one is the joystick ID?

19 次查看(过去 30 天)
Pancy
Pancy 2024-9-30,20:46
编辑: praguna manvi 2024-10-1,5:03
I am trying to use the vrjoystick command in Matlab to create a joystick object. From the help documentation, I should use the command joy = vrjoystick(id). My problem is that I don't know how to find out the id.
The description in help is as follows- "The id parameter is a one-based joystick ID. The joystick ID is the system ID assigned to the given joystick device." But, when I get to the device manager, I saw a lot of "IDs" (e.g. hardware IDs, Compatible IDs, etc.) under the "details" tab of the properties window of the Xbox 360 Controller for Windows. I tried to input everyone one of them, but none of them worked.
How should I get the system ID (there is no system ID in the properties window) of a joystick? How should the ID look like? Thank you.

回答(1 个)

praguna manvi
praguna manvi 2024-10-1,4:50
编辑:praguna manvi 2024-10-1,5:03
Hi @Pancy,
As I understand it, you are trying to use the "vrjoystick" function. The "id" parameter, as mentioned in the documentation, is 1-based, which means it is an integer. If there are multiple joysticks, they might be assigned IDs 1, 2, 3, etc., depending on the order in which they were connected or recognized by the system. You can refer to the documentation below for details about "vrjoystick" properties:
This typically means that the command "vrjoystick(1)" can be used to create a joystick object.
Hope this helps!

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by