I have this accelerometer. http://store.extremeelectronics.co.in/images/D/mma7361_tripleaxisaccelerometer.jpg
Arduino code
#include <AcceleroMMA7361.h>
AcceleroMMA7361 accelero;
int x;
int y;
int z;
void setup()
{
Serial.begin(9600);
accelero.begin(13, 12, 11, 10, A2, A2, A3);
accelero.setARefVoltage(3.3); //sets the AREF voltage to 3.3V
accelero.setSensitivity(LOW); //sets the sensitivity to +/-6G
accelero.calibrate();
}
void loop()
{
x = accelero.getXAccel();
y = accelero.getYAccel();
z = accelero.getZAccel();
Serial.print("\nx: ");
Serial.print(x);
Serial.print(" \ty: ");
Serial.print(y);
Serial.print(" \tz: ");
Serial.print(z);
Serial.print("\tG*10^-2");
delay(500); //make it readable
}
Pin connect:
x-A0
y-A1
z-A2
Sl-13D
0G-11D
3v3-3.3V
GND-GND
GS-10D
ST-12D
and Serial Monitor code is this:
3
Calibrating MMA7361011..................................................
DONE
x: -2 y: -2 z: 100 G*10^-2
x: -2 y: -2 z: 100 G*10^-2
x: -2 y: -2 z: 100 G*10^-2
x: -2 y: -2 z: 100 G*10^-2
x: -2 y: -2 z: 100 G*10^-2
x: -2 y: -2 z: 100 G*10^-2
x: -2 y: -2 z: 100 G*10^-2
x: -2 y: -2 z: 100 G*10^-2
x: -2 y: -2 z: 100 G*10^-2
x: -2 y: -2 z: 100 G*10^-2
How to work...please help me.