This post contains extra details on the receiver of my arcade stick.
PC receives and translates serial data from the controller using MATLAB and JAVA robot class.
I have programmed to operate my stick normally as an arcade stick, and also as a mouse.
In this post I will provide enough hints for anyone to use MATLAB for such purpose.
MATLAB Serial Communication Problem
I noticed many people including me were having problem with MATLAB's serial communication module.
DO THIS BEFORE ANYTHING ELSE!
The following code most likely will fix whatever problem you are having.
priorPorts = instrfind
MATLAB's serial communication apparently does not work well when there are any...
(even the closed ports)
previously declared ports.
The above code just finds and deletes the memory previously allocated for them.
Some useful MATLAB functions are:
first import the class for simplifications later on
make a robot class
robot = Robot;
have fun :D
if (sw1 ~= sw10)
if(sw1 == 1)
sw10 = sw1;
The delay of 20 ms simulates how actual keyboard works.
A keypress function must be released else it will be like a stuck key.
pos = get(0, 'PointerLocation');
x_pos = pos(1)+speed;
y_pos = 768-pos(2)+speed;
Read pointer location and move the mouse.
You can set sensitivity by changing the speed variable.
The first line is included such that you may use your real mouse as well as the joystick to simultaneously move the mouse cursor.
By Joe Kwuen