Thank you for visiting → Compete For Nothing.com ← If you find anything useful leave me a comment and share. Interested in Rapberry Pi, Arduino, C#, Unity3D, Game Creation, VB.NET, learning and most important of all Sharing!.
Close Notification
Open Notification

Using MMA7660 Accelerometer Arduino

Using MMA7660 Accelerometer Arduino
GARD Pro Not Registered

This is a simple script to output MMA7660 Accelerometer values using Arduino UNO.

The libray come from timzaman.com
  • Pinout for Arduino UNO
  • GND = GND
  • VCC = 5v
  • SDA = A4
  • SCL = A5

/*
  GND = GND
  VCC = 5v
  SDA = A4
  SCL = A5
*/

#include <Wire.h>
#include <MMA7660.h>

void setup()
{
  Serial.begin(9600);
  MMA7660.init();
}

void loop()
{
  int x,y,z;
  delay(100); // There will be new values every 100ms
  MMA7660.getValues(&x,&y,&z);
  Serial.print("x: ");
  Serial.print(x);
  Serial.print(" y: ");
  Serial.print(y);
  Serial.print(" z: ");
  Serial.println(z);

}

Dogecoin
Donate Dogecoins: DGkJRWQCyBUeXbenYz18LRN9X67aora9nz Whats This?

3 Comments

  1. Code for MMA7660 Accelerometer #COMP1045 http://t…. · February 21, 2013 Reply

    […] Code for MMA7660 Accelerometer #COMP1045 competefornothing.com/?p=531 […]

  2. Rich McDowell · March 20, 2013 Reply

    In the above file, ” MMA7660.init(); ” give me an error,
    ‘MMA7660’ was not declared in this scope.
    Could you tell me what is wrong?
    Thank You, Rich McDowell

Leave a Reply to Code for MMA7660 Accelerometer #COMP1045 http://t…. Cancel reply