ADXL355 Accelerometer issues on BBB

I am trying to follow the tutorial for the accelerometer found here: http://beagleboard.org/Support/BoneScript/accelerometer/

If I read it right I should be getting back a 1.0 as the resting state on the table. However I get back this:

Analog Read Value x: -4.853507815339876
Analog Read Value y: -4.8716830243547795
Analog Read Value z: -4.835332606324972

I am using the ADXL335 Accelerometer and 470-0ohm 1/4 watt carbon film resistors from radio shack.

So do I just change the below offset and conversion factor? If so how do I find those?

Source code:

var b = require(‘bonescript’);
var zeroOffset = 0.4584;
var conversionFactor = 0.0917;

function callADC(){
b.analogRead(‘P9_36’, printX);
b.analogRead(‘P9_38’, printY);
b.analogRead(‘P9_40’, printZ);
}

function printX(x) {
var value = (x.value - zeroOffset)/conversionFactor;
console.log('Analog Read Value x: ’ +value.toFixed(6));
// when the ADXL335 resting flat on a table or
//board, then readings should be x:0
}

function printY(x) {
var value = (x.value - zeroOffset)/conversionFactor;
console.log('Analog Read Value y: ’ +value.toFixed(6));
// when the ADXL335 resting flat on a table or
//board, then readings should be y:0
}

function printZ(x) {
var value = (x.value - zeroOffset)/conversionFactor;
console.log(‘Analog Read Value z: ’ +value.toFixed(6));
// when the ADXL335 resting flat on a table or
//board, then readings should be z:1
console.log(’’);
}

//callADC will be invoked 20 times a sec or once every 50 ms
var loop = setInterval(callADC, 250);

function clear(){
clearInterval(loop);
}

Luke,

I was not sure if using 470 ohm resistors instead of the 500-1000ohm was causing it. The bigger question is if I use the Z value since that is the third axis for the conversion then how do I measure acceleration in the z axis? I set the zero offset so that the values all =1. Wouldn’t that be sufficient to measure G’s since a value of 1 should equal 1 G? I guess I am trying to see if the conversion factor is a constant that can be hard coded or dynamic based off the other axis?