The joystick on my wii nunchuck was mapped as 0-127-255, with 127 being the value when centered/rested.
I would like to make it smoother, so maybe I could change this linear movement to something like an odd power function. The following graph tries to convey how the variable would change:
Well, a lookup table would be fast, but if memory is important, you might want to consider a function of the form
y = a*(x - 127)^3 . The basic function Y = x^3 has the same shape, so each move of the joystick would create a need to generate an integer cubed (gonna need long integer), followed by (probably) a floating point division to scale it. That may or may not be too time-consuming, depending on your application, and how fast an arduino you want to buy.
My variable changer from 0 to 255, with 127 being the center.
I produced a graph in Excel using 0, 127, 255 and some point in between to produce a trendline similar to the behaviour i was looking for.
I used the equation of that line to redefine the variable and it worked.