The cubic equation is actually fairly easy to use. It looks something like this:
Code:
long temp;
long answer;
long divisor = 127;
temp =((int)p1_y) - 127; //this centers the input range between -127 and 127
answer = (temp*temp*temp) / (divisor*divisor);
answer = answer + 127; //shift the answer back over to the range 0-255
Just make sure you use longs, because you'll overflow an int! The basic idea is that you have a very shallow curve near 0, and a steeper curve near the extremes (-127 and 127). You get all the way to the extremes because 127^3/127^2 is 127. Throw in a couple of more values, and you see that moving the joystick 30 away from center gives you an answer that's only 3 or 4 away, and it can really help.