Arithmetic Operator question

Hi Hulk, I suspect the problem is elsewhere in your code if the only problem is the sign.

Not sure it will help in your app, but wherever possible I like to convert floating point values to longs by multiplying the value by the number of decimal places necessary to give you the precision you need. This allows the code to be smaller and faster.

The following gives GZ that is the actual value times 10,000.

long GZ = analogRead(Z)*488 - 166000;