GithubHelp home page GithubHelp logo

rh101 / mma8453_n0m1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from n0m1/mma8453_n0m1

0.0 0.0 0.0 141 KB

an Arduino Library for the Freescale MMA8453Q & MMA8452Q Accelerometer

Home Page: n0m1.com

C++ 85.99% Arduino 14.01%

mma8453_n0m1's Introduction

Name    : MMA8453_n0m1 Library                         
Author  : Noah Shibley, NoMi Design Ltd. http://socialhardware.net       
		: Michael Grant, Krazatchu Design Systems. http://krazatchu.ca/                  
Date    : October 10th 2013                                 
Version : 0.3                                               
Notes   : Arduino Library for use with the Freescale MMA8453Q and MMA8452Q via i2c. 
          Some of the lib source from Kerry D. Wong
	  http://www.kerrywong.com/2012/01/09/interfacing-mma8453q-with-arduino/
	  This library has been tested with the Freescale MMA8453Q and MMA8452Q
	  Accelerometer chips. MMA8451 has 14bits digital resolution and it is
	  not implemented in this version.
	  Refer to the examples for how to use this library.
	  To use with MMA8452, uncomment #define MMA8452 in MMA8453_n0m1.h
			
Dependencies:	
	none

List of Functions:

Function: setI2CAddr
Description: set the i2c device address to a new value, default is 0x1C
Parameters: (int) device address: a common value is 0x1D
------------------------------------------------------	
Function: dataMode
Description: set the device to return raw data values
Parameters: (boolean) enable highRes 10bit,
	    (int) set g force range: [2g,4g,8g]
------------------------------------------------------
Function: x
Return: (int) returns the x axis value
------------------------------------------------------
Function: y
Return: (int) returns the y axis value
------------------------------------------------------ 
Function: z
Return: (int) returns the z axis value
------------------------------------------------------
Function: shakeMode
Description: set to transient detection mode
Parameters: (int) threshold [0-127] formula: 6g/ 0.063g = 95.2 counts, round to 96,
   	    (boolean) enable X, 
   	    (boolean) enable Y,
   	    (boolean) enable Z, 
   	    (boolean) enable MMA8453Q INT pin 2 (false= pin 1), 
   	    (int) arduino INT pin number
------------------------------------------------------
Function: shake
Return: (boolean) returns true if there is shaking (high pass filtered motion)
------------------------------------------------------
Function: shakeAxisX
Return: (boolean) returns true if there is shake on the x axis
------------------------------------------------------
Function: shakeAxisY
Return: (boolean) returns true if there is shake on the y axis
------------------------------------------------------
Function: shakeAxisZ
Return: (boolean) returns true if there is shake on the z axis
------------------------------------------------------ 
Function: motionMode
Description: set to motion detection mode
Parameters: (int) threshold [0-127] formula: 6g/ 0.063g = 95.2 counts, round to 96,
   	    (boolean) enable X, 
   	    (boolean) enable Y,
   	    (boolean) enable Z, 
   	    (boolean) enable MMA8453Q INT pin 2 (false= pin 1), 
   	    (int) arduino INT pin number
------------------------------------------------------  
Function: motion
Return: (boolean) returns true if there is motion
------------------------------------------------------ 
Function: update
Description: update data values, or clear interrupts. Use at start of loop()
------------------------------------------------------ 
Function: regRead
Description: read one of the accelerometer registers
------------------------------------------------------ 
Function: regWrite
Description: set one of the accelerometer registers
------------------------------------------------------
Function: setRangeSetting
Parameters: (int) gScaleRange set g force range: [2g,4g,8g]
Description: Compatibilty Function
------------------------------------------------------
Function: setFullResBit
Parameters: (boolean) highRes enable highRes 10bit
Description: Compatibilty Function
------------------------------------------------------
Function: readAccel
Parameters: (int) *x pass x pointer
	    (int) *y pass y pointer
	    (int) *z pass z pointer
Description: Compatibilty Function

mma8453_n0m1's People

Contributors

aureleq avatar n0m1 avatar nullboundary avatar

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.