labradore / unojoy

Automatically exported from code.google.com/p/unojoy
0 stars 0 forks source link

change axe z #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What the problem?
In your soft, windows find right stick X and Y is the Z axes,
I prefer he recognise right stick X and Y as axe X and Y.

Please tell me how change this. My project is a mamecab, with a frontend 
atomicfe (he doesn't recognize D_pad in menu only axe) i don't use Z axes, I 
use only 6 buttons and X Y axes. 

What version of the product are you using? On what operating system?
I use 24may2012 version on windows 7 64 bits. 

Please provide any additional information below.
Sorry for my english, i'm a french users, otherwise great job.

Original issue reported on code.google.com by j3r0m3.f...@gmail.com on 27 Jul 2012 at 11:33

GoogleCodeExporter commented 8 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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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:

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
No problem!  I'm glad you got things working!

Original comment by alan.chatham@gmail.com on 31 Jul 2012 at 4:55

GoogleCodeExporter commented 8 years ago

Original comment by alan.chatham@gmail.com on 31 Jul 2012 at 4:57