S-Function for reading joystick values on Simulink
Version 1.0.5 (48,5 ko) par
Johannes Soikkeli
S-Function build using Windows JOYINFOEX (Winmm.lib). This S-Function supports Rapid Accelerator. Currently outputs 4 axis and 12 buttons.
Enhanced S-Function for Reading Joystick Values in Simulink
This S-Function enables high-performance joystick input within Simulink models, particularly those utilizing Rapid Acceleration for significant speed improvements.
Key Features:
- Rapid Acceleration Support: Overcomes limitations of the standard Simulink joystick block.
- Enhanced Axis and Button Input: Leverages the Windows JOYINFOEX function from the Winmm library for extended joystick capabilities compared to the original JOYINFO-based version.
Motivation:
Developed to address the lack of Rapid Acceleration compatibility in the default Simulink joystick block, crucial for optimizing large-scale flight dynamics simulations.
Installation and Usage:
- Obtain WinMM.lib: Install the Windows SDK and locate WinMM.lib within the appropriate CPU architecture folder (C:\Program Files (x86)\Windows Kits\10\Lib\10.0.26100.0\um\[architecture]).
- Copy WinMM.lib: Place WinMM.lib in the same directory as the downloaded sfun_joyinfoex.c file.
- Compile S-Function (Requires MinGW64 Compiler) on MATLAB command line: mex sfun_joyinfoex.c -lwinmm
- Use in Simulink: Open and run joyinfoex_demo.slx in Rapid Accelerator Mode to test the compiled S-Function.
Credits:
Original S-Function concept by Per Hillerborg. This enhanced version includes modifications to support additional joystick axes and buttons, as well as overall S-Function structure improvements.
Citation pour cette source
Johannes Soikkeli (2025). S-Function for reading joystick values on Simulink (https://fr.mathworks.com/matlabcentral/fileexchange/111265-s-function-for-reading-joystick-values-on-simulink), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Créé avec
R2021b
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS LinuxTags
Remerciements
Inspiré par : sfun_joystick.zip
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
| Version | Publié le | Notes de version | |
|---|---|---|---|
| 1.0.5 | Returned the warning when deviceID is wrong. |
||
| 1.0.4 | typo |
||
| 1.0.3 | There was a small bug in the c-code; Fixed now. Improved installation guide. |
||
| 1.0.2 | Removed the WinMM.dll file based on MathWorks policies. |
||
| 1.0.1 | Removed already compiled .mex file due to MathWorks policies. |
||
| 1.0.0 |
