Git Product home page Git Product logo

mma8452_accelerometer's Introduction

SparkFun Triple Axis Accelerometer Breakout - MMA8452Q

SparkFun Triple Axis Accelerometer Breakout - MMA8452Q [SEN-12756] SparkFun Triple Axis Accelerometer Breakout - MMA8452Q (with Headers) [BOB-13926]

This breakout board makes it easy to use the tiny MMA8452Q accelerometer in your project. The MMA8452Q is a smart low-power, three-axis, capacitive micro-machined accelerometer with 12 bits of resolution.

Repository Contents

  • /Firmware - Example Arduino sketches for interfacing with the accelerometer
  • /Hardware - All Eagle design files (.brd, .sch)
  • /Libraries - Libraries for use with the accelerometer
  • /Production - Production panel files (.brd)

Documentation

Product Versions

License Information

This product is open source!

The hardware is released under Creative Commons ShareAlike 4.0 International.

The code is beerware; if you see me (or any other SparkFun employee) at the local, and you've found our code helpful, please buy us a round!

Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license.

Distributed as-is; no warranty is given.

  • Your friends at SparkFun.

mma8452_accelerometer's People

Contributors

bboyho avatar billpugh avatar frencil avatar nseidle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mma8452_accelerometer's Issues

Hangs when using 2 accelerometers

I´m using two accelerometers for a project but when using with ODR over 50 it keeps hanging after a few seconds operating. Apparently it is losing some data because just after checking the available() it freezes inside the read(). I tried to replace the WIRE library for the I2C I founded on another issue thread and it seems to be working now. Is this approach correct?

Problem with sampling frequency

Hey there, I am just experiencing issues to initialize (or to change) the sampling frequency. I thought the default value is 800Hz, but the data I collected using Arduino is way less than 800Hz, its more like 20Hz something. Can someone help me with how to adjust the sampling frequency?

Teensy 2.0

It won't post any data on Teensy 2.0. (It does post data with Teensy 3.0)

x, y, z values not processing correctly

The x, y, and z values as read from the MMA come as 2's complement 12-bit numbers, and are assigned directly to integers. At least on 32-bit systems (Teensy) this doesn't work correctly for negative G-values and they need to be converted into signed values.

One fix is to add the following lines after the assignment of x,y and z and before cx/cy/cz:

    // Convert the 2's complement 12-bit values to signed integers.
    x = (x >> 11) == 0 ? x : -1 ^ 0xFFF | x;
    y = (y >> 11) == 0 ? y : -1 ^ 0xFFF | y;
    z = (z >> 11) == 0 ? z : -1 ^ 0xFFF | z;

Signedness bug in Basic Example

Running on Teensy 3.0

Something seems to be wrong in the Basic Example lines 86,87

When changing signs, the number suddenly turns huge. I fixed this by replacing tines 86,87 with:
gCount -= 4096;//not sure if this needs a +1 or not...

This is probably due to teensy3.0 using 32bit integers.

No need to wait for data after Wire.requestFrom()

In two places in SparkFun_MMA8452Q.cpp, there is a while-loop after the Wire.requestFrom() call. That while-loop is not needed.

When the Wire.requestFrom() function returns, the I2C transaction has completely finished and the received data is in the receive buffer in the Wire library. The Wire.read() only reads data from that buffer.

When there was a I2C bus error or I2C collision, there would be less bytes received, and that while-loop would halt the sketch.

A4/5 pins

I am trying to run the Advanced code on a different Arduino that only had pins A0-A3. How would i change the code to adapt the accelerometer advanced sample code to an Arduino without A4/A5 pins?

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.