ADXL335 x/y output values

I'm experimenting with a Sparkfun ADXL335 board and have started measuring the values to of the x/y/z axes outputs, using the 3.3v source on the arduino board. On a level surface I should be getting a reading of 337.6.

What I'm finding is that I'm getting slightly different x and y readings (342 and 337 respectively). So the y reading is ok at 0degrees but the x axis appears to be out by 4 degrees. rotating the board horizontally doesn't change the readings much so it looks like simply a slight output variation on the pins themselves.

Is this variation to be expected? Should I simply add a voltage offset to get the x value to be 0 degrees?

Any help would be appreciated.

Is this variation to be expected?

Yes, this is to be expected. The (in)accuracy of the ATMega ADC by itself would explain this difference. In addition to this you have a possible offset error of the Arduino 3V3 regulator as well as accuracy limitations in the ADXL335 which all add up.

My approach when working with analog devices such as this has been to create a small test sketch to establish zero point for each axis. You can do this by averaging 1000 (or even 10000) readings and compute an average to use as a zero reference. Then you may also need a similar approach to calculate a scale factor. Ideally this should be 1.0, but typycally may me slightly above or below.

When you have these values (offset and scale factor per axis) you will use them in your application to improve the accuracy of individual samples. You may further improve the accuracy of individual readings by averaging (e.g. 4, 8 or 16 samples) before you make use of them in your application.