Most of the code is in the Arduino board on the EDTracker. I’ll pull the relative files and post a link later today.
I think there’s more to this. Accel values can go beyond 25 either way, though practically it’s unlikely as you need to put more effort into moving the controller than you’re likely to do in game. Likewise, gyroscope values aren’t limited to -10 to +10.
The code for JoyShockMapper (
https://github.com/JibbSmart/JoyShockMapper) shows one way to use a device with a gyroscope and accelerometer to determine orientation and maps the vector components to XY. EDTracker (
https://github.com/brumster/EDTracker2) essentially does the same thing. On a PC these XY values are enough for Elite Dangerous. I think they’d also be enough for Elite Dangerous on a console if you only wanted/ needed headlook occasionally (through a momentary or long lasting toggle). I want headlook to work continually like it does on a PC, however. For that, using the above approach, I’d either need a pair of analog axes or four digital inputs that wouldn’t get in the way of other inputs. There’s already so much to control in Elite Dangerous that, with the limited inputs available on console, I’ve not gone down this path yet (though, at this point, I think I’ll have to). Finding those inputs, and programming the T2 so they don’t get stepped on, is my next step. If we can do that we can ignore the accel/gyro inputs completely.