A MEX function that returns joystick axes and buttons. It should be reasonably portable since it's based on SDL which runs on Mac, Linux, Win.
>> [j,b] = joystick
j =
0 0 -0.0039 0.0039
b =
0 0 0 0 0 0 0 0 0 0 0 0
Could be wrapped into an S-function.
Simulink comes with similar functionality if you have the 3D Animation Toolbox.
Tested on R2012b MacOS 10.8.2 (ML) with SDL 1.2.15.
引用格式
Peter Corke (2024). Joystick MEX file (https://www.mathworks.com/matlabcentral/fileexchange/41041-joystick-mex-file), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2012b
兼容任何版本
平台兼容性
Windows macOS Linux类别
- Simulink > Simulation >
- MATLAB > External Language Interfaces > C with MATLAB > Write C Functions Callable from MATLAB (MEX Files) >
在 Help Center 和 MATLAB Answers 中查找有关 Simulation 的更多信息
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!