Hey guys,
I have 2 variables, angle_x and angle_y, from an accelerometer. I want to subtract the current value of the variable from the previous value of the same variable. I tried this,
int x_initial = angle_x ;
int x_final = x_initial - angle_x
But I am not sure how to make it so angle_x is the previous value, and x_initial is the current value. Any help would be greatly appreciated. Thanks.
SR
SteveRogers:
I want it to keep adding on to the old number.
Perhaps you ought to give some examples of what you're trying to achieve, because 'adding on to the old number' seems to be the exact opposite of what you originally described.