How to invert an axis?

SpaceOrb drivers and software discussions
Forum rules
Vigil
Posts: 10
Joined: September 12 2010, 11:44 AM

How to invert an axis?

Postby Vigil » March 15 2015, 11:45 AM

My favourite racing game, Trackmania, insists on steering left when I want to go right, and vice versa. This happens with another controller — Thrustmaster Run 'n' Drive. Both the Thrustmaster and the SpaceOrb work fine in other games, so it's a problem with the game, not the hardware. With the Thrustmaster, I have the ability to reprogram its buttons and sliders on the controller itself, so I can invert the steering directly like that. How would I do so with the SpaceOrb? I see that the WASD profile code has a comment to invert some mouse axes, but I want to use the BasicJoystick profile, and invert what appears as "Slider" in the Windows game controller properties.



Of course, the real solution is for Trackmania to fix this, but I didn't see a solution on their and the Steam forums.

vputz
Posts: 339
Joined: March 25 2006, 20:21 PM
Contact:

Re: How to invert an axis?

Postby vputz » March 19 2015, 19:06 PM

Sorry it took me a few days to see this! Actually, I think you should be able to use the BasicJoystick sketch. All you need to do is... oh, man! It's been a while; let me look. "Per-axis gain" is I think the way it should be done. Hang on a sec...



Okay, okay, wasn't that. Um, this is totally non-obvious; sorry--I should fix the documentation! Look in BasicJoystick sketch, and you need to add a couple things. I think (as I said elsewhere I'll be away until Wednesday so if this doesn't work I'll help diagnose when I get back).



At the top, under


[code]
Orbotron_device orb_device;
[/code]


add


[code]
const PROGMEM short Polarity = [1,1,1,1,1,1];
[/code]


And in setup(), at the bottom, add the line


[code]
translator.set_polarity( Polarity );
[/code]


Okay! Now change one of those "1" values to "-1". The problem is I don't know which one. It'll be one of the last three probably.



Um... good luck? Sorry--I'll help more if it doesn't get going by the end. If you need help installing the libraries and the Arduino environment, don't forget you need Arduino 1.0.3 (until I update... I will someday) and follow the instructions at http://wiki.thingotron.com/doku.php?id=products:orbotron9000.



Good luck!

Vigil
Posts: 10
Joined: September 12 2010, 11:44 AM

Re: How to invert an axis?

Postby Vigil » March 21 2015, 10:08 AM

Slight change of syntax, otherwise it wouldn't compile, and for me, this was the one I had to change to get inverse steering:


[code]const short Polarity[] PROGMEM = {1,1,1,1,-1,1};[/code]

I am coming first again! Thank you.


Return to “Spaceware Software”

Who is online

Users browsing this forum: No registered users and 1 guest