Giter Site home page Giter Site logo

change axe z about unojoy HOT 8 CLOSED

zuchen93 avatar zuchen93 commented on July 17, 2024
change axe z

from unojoy.

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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 [email protected] on 27 Jul 2012 at 3:48

  • Added labels: ****
  • Removed labels: ****

from unojoy.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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 [email protected] on 28 Jul 2012 at 11:50

  • Added labels: ****
  • Removed labels: ****

from unojoy.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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 [email protected] on 29 Jul 2012 at 5:40

  • Added labels: ****
  • Removed labels: ****

from unojoy.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
Hi,

encolsed the programmes I use in arduino. It's juste a modified exemple 
programme.

thank you for your help.

Original comment by [email protected] on 29 Jul 2012 at 4:20

  • Added labels: ****
  • Removed labels: ****

Attachments:

from unojoy.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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 [email protected] on 30 Jul 2012 at 6:28

  • Added labels: ****
  • Removed labels: ****

from unojoy.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
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 [email protected] on 31 Jul 2012 at 2:05

  • Added labels: ****
  • Removed labels: ****

from unojoy.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024
No problem!  I'm glad you got things working!

Original comment by [email protected] on 31 Jul 2012 at 4:55

  • Added labels: ****
  • Removed labels: ****

from unojoy.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 17, 2024

Original comment by [email protected] on 31 Jul 2012 at 4:57

  • Changed state: Done
  • Added labels: ****
  • Removed labels: ****

from unojoy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.