Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do I add the joy con analog sticks? #24

Open
SpiderHulkZM opened this issue Sep 2, 2021 · 4 comments
Open

how do I add the joy con analog sticks? #24

SpiderHulkZM opened this issue Sep 2, 2021 · 4 comments

Comments

@SpiderHulkZM
Copy link

I don't know how to connect the analog sticks

@KaizenCris
Copy link

Hi, I know this issue is old, so I'm unsure if I should open a new one.
I see the button events getting triggered by ButtonEventJoyCon. But not the Joy stick events.
Is this feature available?

Is there any example of how to get this data?

@KaizenCris
Copy link

KaizenCris commented Mar 11, 2023

I found the answer. So in case anyone else need it too here it is:
It can be found using the get_status() function inside the 'analog-sticks' key

You can also use get_stick_left_horizontal() and get_stick_left_vertical() functions in case you don't need all the status results.

from pyjoycon import JoyCon, get_R_id
import time

joycon_id = get_R_id()
joycon = JoyCon(*joycon_id)

while(1):
    print(joycon.get_status()['analog-sticks'])
    print(joycon.get_stick_left_horizontal(), joycon.get_stick_left_vertical())
    time.sleep(0.05)

It seems the output is not so intuitive so I used the joycon.py file included in this fork. (That way I get (+) or (-) results depending on left right top bottom):

And that's it = )

@nahlahman
Copy link

Is there a way to implement the joycon's calibration data for the sticks with joycon-python?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants