Closed GoogleCodeExporter closed 9 years ago
Hi there -
By default, the left stick is mapped to the X and Y axes in Windows, so if you
only have one joystick in your controller, if you map your joystick input to
leftStickX and leftStickY in Unojoy, things should work. I would also make
rightStickX = 128 and rightStickY = 128, since if any of your programs
recognize the Z axis, this will keep that axis from moving about wildly.
Let me know if that helps or not!
Original comment by alan.chatham@gmail.com
on 27 Jul 2012 at 3:48
Hello and thanks for your answer,
I map my joystick like this: leftstickX -> A3 (left in my gamepad), leftstickY
-> A4 (up), rightstickX -> A5 (right)and rightstiskY -> A2 (down). Is this ok ?
in this mode the right and down is Z axes.
You say " I would also make rightStickX = 128 and rightStickY = 128", but where
i change this ? in Unojoy.h ?
Thanks.
Original comment by j3r0m3.f...@gmail.com
on 28 Jul 2012 at 11:50
What code are you using? In your program, at some point, you should be setting
up a dataForController_t variable (let's call it controllerData), and at some
point in your code, assigning values to it's data members, such as
controllerData.leftStickX or controllerData.circleOn.
Original comment by alan.chatham@gmail.com
on 29 Jul 2012 at 5:40
Hi,
encolsed the programmes I use in arduino. It's juste a modified exemple
programme.
thank you for your help.
Original comment by j3r0m3.f...@gmail.com
on 29 Jul 2012 at 4:20
Attachments:
Okay, so down in the code here:
controllerData.leftStickX = analogRead(A3) >> 2 ;
controllerData.leftStickY = analogRead(A4) >> 2 ;
controllerData.rightStickX = analogRead(A5) >> 2 ;
controllerData.rightStickY = analogRead(A2) >> 2;
That sets up what pins will be read in as the left and right joysticks. So,
you can either change the code here, or you can have the lines from your
joystick go into Analog Pin 3 and 4 in order to control the left joystick.
Original comment by alan.chatham@gmail.com
on 30 Jul 2012 at 6:28
ok I understand, I mixed the stick, these are the two sticks on the pad. I'm
stupid. I thought the right stick is up and down. windows find the up and down
Thank you for your help,
Original comment by j3r0m3.f...@gmail.com
on 31 Jul 2012 at 2:05
No problem! I'm glad you got things working!
Original comment by alan.chatham@gmail.com
on 31 Jul 2012 at 4:55
Original comment by alan.chatham@gmail.com
on 31 Jul 2012 at 4:57
Original issue reported on code.google.com by
j3r0m3.f...@gmail.com
on 27 Jul 2012 at 11:33