2 questions about adxl337 output



1- although breakout powered through 3.3 v pin, readings of 0 g on x axis @ rest 675 divider, while 1023 divider (for 3.3v) gives readings of -1 g (see txt files attached.)

2- 675 divider, acceleration along x axis tops @ .6 or .7 g when moved horizontal vertical (see txt file attached).

this sounds little big calibration issues maybe is. that's know.

thanks!

code:

code: [select]

int scale = 3;

float mapf(float x, float in_min, float in_max, float out_min, float out_max)
{
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}


void setup() {
serial.begin (115200);
}

void loop()
{
 
int rawx1 = analogread (a0);
int rawy1 = analogread (a1);
int rawz1 = analogread (a2);

int rawx2 = analogread (a3);
int rawy2 = analogread (a4);
int rawz2 = analogread (a5);

float gammax1, gammay1, gammaz1, gammax2, gammay2, gammaz2;

gammax1 = mapf (rawx1, 0, 675, -scale, scale);//- 0.066;
gammax2 = mapf (rawx2, 0, 675, -scale, scale);//- 0.08;


delay (1000);

serial.print (gammax1);
serial.print ("\t");
serial.println (gammax2);

}

i assume have changed username cecilia90 nicolasp.

please see post #7 in thread:
http://forum.arduino.cc/index.php?topic=357328.0


Arduino Forum > Using Arduino > Sensors > 2 questions about adxl337 output


arduino

Comments