Git Product home page Git Product logo

mma8452q's Introduction

MMA8452Q

The MMA8452Q is a tiny and low-power three-axis accelerometer. This library implements a simple interface to access most of the accelerometer functionality from an Arduino.

FEATURES

  • Normal and fast raw axes values reading
  • Scale configuration (allowed 2g, 4g and 8g scales)
  • Custom offset calibration
  • Low noise mode
  • Orientation detection (portrait/landscape and back/front)
  • Auto-WAKE/SLEEP mode and detection

GETTING STARTED

#include <MMA8452Q.h>
#include <Wire.h> /* so the Arduino IDE auto-detects the dependency */

MMA8452Q accel;

int axes[3];

void setup() {
  Serial.begin(9600);

  if (accel.begin())
    while (1); /* error */
}

void loop() {
  /* get and print raw axes values */
  accel.axes(axes);

  Serial.print("x: ");
  Serial.print(axes[0]);
  Serial.print(", y: ");
  Serial.print(axes[1]);
  Serial.print(", z: ");
  Serial.println(axes[2]);

  delay(1000);
}

See the API reference for more information.

TODO

  • Motion and freefall detection
  • Single and double tap detection
  • Interrupts configuration

DEPENDENCIES

The only dependency is the standard Wire Arduino library.

INSTALLATION

Just clone the repository into your user libraries directory.

For more info, have a look at the Arduino guide page.

COPYRIGHT

Copyright (C) 2013 Alessandro Ghedini <[email protected]>

See COPYING for the license.

mma8452q's People

Contributors

ghedo avatar

Stargazers

Sakura avatar Solder Spot avatar Keith Elliott avatar

Watchers

 avatar Solder Spot avatar

Forkers

jokemilk per1234

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.