Joystick left Hand and right hand for unity game

Hello guys
I am creating a joystick for games i am with an arduino micro with joystick.h program on laptop

  // right hand

xAxis_ = analogRead(A2);
xAxis_ = map(xAxis_,0,1023,xAxis_min,xAxis_max);

// left hand
yAxis_ = analogRead(A1);
yAxis_ = map(yAxis_,0,1023,yAxis_min,yAxis_max);

in the game i need
move left hand to turn to the left
move right hand to turn to the righ
i can also move the both hand in the same time but not with the same value

when i use a game where i can choose my axis it works well. but when i can't game consider right hand like xaxis (left right) and left hand like y axis (up down)

if we used keybord games will condider the 4 arrows and the time to press on it and manage correctly when you press left and right arrows in the same time.
Games are design on unity

My next step will be to be capable to do it on an android game too

Thanks for your help

I don't see a question here. What are you asking for?

My first question is what is the way to use to have left hand input and right hand input when your software seems to read only an x axis?
Knowing that it could compatible with an occulus for exemple
The software is paragliding sim

My second question is how can i replace tactile touch screen input on android? I know that joystick are understand by the phone thanks to a joystick test application but the game doesn't use it.

Thanks for your help

I don't think this is going to happen without modifying the software. If your project hinges on this then it's not likely to be viable.

There is an Arduino XInput Library. An XInput gamepad is basically an XBox360 controller. An XInput gamepad has 2 XY joysticks, 2 analog throttles, and lots of buttons.

PS4/PS5 controllers have touchpads but I do not know of any Arduino library to emulate Playstation controllers.

Thanks for yiur answers guys

I will try with Xinput, i had see it but not try it yet.

In the wait of your answer i cheat the sofware thanks to calculation.
As left hand + right hand = brake
I get a value of brake send to the y axis and keep the difference between left hand and right han values on x axis.
That solved my 1st problème

For the second on problem if we are capable to have mouse in our phone thanks to arduino why can't we replace signals from touchscreen ?
I am newbie but my think was if we can get the adress of the touch screen if we send value on these adress it should be understand by the phone and the game like if it was the touch screen working

Could you tell me why i am wrong please?

I find this page which seems to be very interesting but i don't know how to use it.

If someone can explain me it will be great.


These aren't really Arduino question, which is the primary focus of this forum.
Your Android specific question will likely get more answers here: Android Enthusiasts Stack Exchange

I think it is arduino question because i want my arduino micro do this kind of job to replace touch screen thanks usb port in the objective to send position and stroke of mouvement read on potentiometer.
Thanks for your help

You are asking multiple questions. The question on which your project hinges is clearly an Android question. Once you've come to an answer for that in an Android forum, then helping you with the Arduino stuff here will be much easier.

For now I'd argue that your Arduino questions cannot be accurately answered as we won't know how you need to provide the input.

The Android question is very hard to understand what you want to do.

On the last part of my project i wandto use 2 potentiometer (one for left hand and another to right them)

Thanks to them i want do the same thing like if you have 2 fingers on the screen of your smart phone and move down them with different stroke

Potentiometer are on analogic input A1 and A2 on an arduino micro

I hope this description help to understand. Thanks for your time

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.