Code:
int cube1 (unsigned char p1_y)
{
return((int)p1_y * (int)p1_y * (int)p1_y);
}
and you'll need to use casts to up the unsigned char to ints. Also, you can't use p1_y as a passed argument - its defined in ifi_aliases.h:
Code:
ifi_aliases.h:30: #define p1_y rxdata.oi_analog01
and unless you are absolutely certain of the precedence rules for applying operations - use parentheses to eliminate any questions:
Code:
pwm01 = cube() - (3 * square() ) + (5 * p1_y); /*x^3-3x^2+5x* A cubic function to regulate the sensitivity of the robot's drive*/
pwm02 = cube2() - (3 * square2()) + (5 * p2_y); /*same thing, son*/