The MMA7455 accelerometer is a sensor that can measure acceleration in three axes. This sensor is commonly available as a breakout board that you can connect to your Arduino. It requires VCC, GND , SCA and SCL to be connected.
Here is a picture of the sensor breakout.
Here is how to wire the MMA7455 accelerometer to your Arduino
You will need a copy of the MMA_7455 library to make your life easier. Download and copy to your Arduino -> Libraries folder
This example simply displays the X, Y and Z axes settings in the serial monitor
#include <Wire.h> //Include the Wire library
#include <MMA_7455.h> //Include the MMA_7455 library
MMA_7455 mySensor = MMA_7455();
char xVal, yVal, zVal;
Serial.println(“MMA7455 Accelerometer Test.”);
xVal = mySensor.readAxis(‘x’); //Read the ‘x’ Axis
yVal = mySensor.readAxis(‘y’); //Read the ‘y’ Axis
zVal = mySensor.readAxis(‘z’); //Read the ‘z’ Axis
Serial.print(“X = “);
Serial.print(” Y = “);
Serial.print(” Z = “);