フィルターのクリア

Light gun output to MATLAB

2 ビュー (過去 30 日間)
Robin Kramer
Robin Kramer 2022 年 1 月 23 日
回答済み: Divit 2023 年 10 月 10 日
I was wondering whether anyone had used a computer/video games light gun as an input to MATLAB? Perhaps during a Psychtoolbox-made experiment (though not necessarily)? All I want to do is have MATLAB continually check the gun (would this be the same as checking the mouse? KbCheck?) and then record the precise computer clock's time that the trigger was pulled.
Any advice would be much appreciated! Suggestions for guns that work for this? Code? Alternatives?
Thanks!

回答 (1 件)

Divit
Divit 2023 年 10 月 10 日
Hi Robin,
I understand that you would like to know if exists a way to use a light gun as an input to MATLAB.
Using a light gun as an input to MATLAB would depend on whether the light gun can be recognized as a standard input device by your operating system (like a mouse or a joystick). If it can, then you should be able to use it with MATLAB.
As for Psychtoolbox, it has functions to get input from a mouse and a joystick. If your light gun can emulate a mouse, you can use the GetMouse function or else if your light gun can emulate a joystick, you can use the Gamepad function in Psychtoolbox to get the position and button state of the light gun.
To learn more, you can refer to the following documentation links:

カテゴリ

Help Center および File ExchangeTiming and presenting 2D and 3D stimuli についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by