Tok_Tok wrote:Thanks for the sketch, really useful! But I can't get it to work completely.
I've uploaded your sketch to my Micro pro and hooked up an analog stick from a gamecube controller but the in the game controller software in windows the cursor is shaking constantly. Also it won't go to the left upper and right lower corner. Do you know why this is?
To be clear, the cross will go to the right upper and left lower corner. Somehow it does not register the Y axis.
Edit: changing the values removed shaking a bit.
Can you describe how you have the analog stick hooked up?
My suggestion is that the stick you are using has different readings/different resistance than a PSP 1000 analog stick like I have used.
It is relatively simple to fix this though, you connect your stick to the arduino like you would, send the values you read from there out with
Serial.println(xValue);
(or x1Value / x2Value / y1Value / y2Value)
Open a serial monitor and move the stick to as far left / right / up / down as possible. The reading you get when you move it to the left for example then is the new value for your first X (Currently 400). The reading you get when you move it to the right is then your new value for the second X (currently -400). Repeat the same steps with the Y Axis and it should be OK.