Go Down

Topic: Please help!Newbie on ADXL335 (Read 494 times) previous topic - next topic

tlslaj0417

Hi when i connect with arduino Uno, i saw output:
326 326 400

how do i change the these value for each axis into acceleration value?in real ms-2 unit...appreciate for any1 to replied, thanks in advance

pylon

Quote
Hi when i connect with arduino Uno, i saw output:


Using what circuit? Running which code? You have to help us to help you...

tlslaj0417



Using what circuit? Running which code? You have to help us to help you...

it is just a simple code:
Code: [Select]

const unsigned int X_AXIS_PIN = 0;
const unsigned int Y_AXIS_PIN = 1;
const unsigned int Z_AXIS_PIN = 2;
const unsigned int BAUD_RATE = 9600;

void setup() {
  Serial.begin(BAUD_RATE);
}

void loop() {
  Serial.print(analogRead(X_AXIS_PIN));
  Serial.print(" ");
  Serial.print(analogRead(Y_AXIS_PIN));
  Serial.print(" ");
  Serial.println(analogRead(Z_AXIS_PIN));
  delay(100);
}

how can i get the acceleration from the output?

pylon

You may have to adjust some values but you find an example of how to use the sensor on this page:

http://bildr.org/2011/04/sensing-orientation-with-the-adxl335-arduino/

Go Up