I'm using Raw Input to read a HOTAS throttle and joystick that I have. There are button and axis readings, and the axis data comes across as an integer that fulfills a certain bit precision. For instance, some axis data comes across as 10 bit data, so it spans the range of 0 - 1023. (16 bit data comes across as 0 - 65535, etc.)
That's fine, but some of these axes are "centered". For instance, my throttle has a 10-bit left-right paddle that starts out giving me a reading of 512. Toggling it left produces values down to 0, and toggling it right produces values up to 1023. But that's unbalanced. It means if I just offset by -512 and divide by 512, I'll get values from -1.0f to 0.998f
Is there a good way to remap this axis data to -1.0 to 1.0 for bipolar values like this?