Teensy 2.0 WII U Joystick range
Posted: Sat Sep 03, 2016 2:59 pm
Hi
I'm trying to program teensy to use WII U joystick.
Joystick.X(analogRead(0)
Joystick.Y(analogRead(1)
This working fine in windows but in retropie it will not detect joystick movement as the maximum range is too small.
The standard arduino joystick module is around 10 kOhm but wii u is around 5k
So I used some code from net to double the range
Joystick.X(((analogRead(0) -512) * 2) + 512);
Joystick.Y(((analogRead(1) -512) * 2) + 512);
Again this solve the range issue but some axis doing strange things when moved to max position. When the analog X reaches max position it jumps to maximum value on analog Y.
So the question is how to control the max value or limit the max range on X,Y.?
Any sample code for Tennsy 2.0 will be appreciated
I'm trying to program teensy to use WII U joystick.
Joystick.X(analogRead(0)
Joystick.Y(analogRead(1)
This working fine in windows but in retropie it will not detect joystick movement as the maximum range is too small.
The standard arduino joystick module is around 10 kOhm but wii u is around 5k
So I used some code from net to double the range
Joystick.X(((analogRead(0) -512) * 2) + 512);
Joystick.Y(((analogRead(1) -512) * 2) + 512);
Again this solve the range issue but some axis doing strange things when moved to max position. When the analog X reaches max position it jumps to maximum value on analog Y.
So the question is how to control the max value or limit the max range on X,Y.?
Any sample code for Tennsy 2.0 will be appreciated