Hey Walter!
Got it working! There was a line of code at the bottom XTilt = -XTilt that needed to be removed. The output from the sensor is in the 1800-2000 range so to multiply by 20 still keeps things under the 65536 limit so then a divide by 99 brings things back to "normal" range. Just as a "check" I bought a small digital level to use as a reference and there are errors over range of up to 3 degrees! Wish I had an ARCSIN function!




Bookmarks