Hi, I am trying to figure out how to get my leonardo to work as a joystick using an x and y analog input from a joystick module I don't have any code to post cause I am kind of lost where to start.
I have been following this indestructible and using the joystick library included in the guide.
Dividing by 4 converts the 10-bit output range of analogRead() to match the 8-bit input range of Joystick.setXAxis(). Could also be written as '>>2' (shift right logical by 2 bits).
Ahhh I see, thanks a lot for the help, my project is working now and almost done, the joystick has very high sensitivity though is there a way of changing the sensitivity through ardurino and/or create a deadzone for the centerpoint? I have tried calibrating it through windows which has helped find the centerpoint but it's still unreliable at the moment.