Giter Site home page Giter Site logo

seeed-studio / seeed_arduino_adxl345 Goto Github PK

View Code? Open in Web Editor NEW
4.0 14.0 2.0 19 KB

This library come with an ADXL345 chip that is used for the Seeed graphical programming project and can get the accelerometer of the X/Y/Z-axis.

License: MIT License

C++ 100.00%
accelerometer-adxl365 grove grovelibrary adxl345

seeed_arduino_adxl345's Introduction

##Accelerometer_ADXL345 image

This is a high resolution digital accelerometer providing you at max 3.9mg/LSB resolution and large ±16g measurement range. It's base on an advanced 3-axis IC ADXL345. Have no worry to implement it into your free-fall detection project, cause it's robust enough to survive upto 10,000g shock. Meanwhile, it's agile enough to detect single and double taps.It's ideal for motion detection, Gesture detection as well as robotics.

Note:

This library is used for Seeed graphical programming Project only.

API

Initialize:

void init();  // should be called before read data 

Read data

/* 
 * Function Name: AxisDigitalAccelerometerRead 
 * Input: PinName, useless, can be any value 
 *        _xyz – chanel choose 
              'X' - read acc_x 
              'Y' - read acc_y 
              'Z' - read acc_z 
 * Return: distance in cm   
 */ 
float AxisDigitalAccelerometerRead(int PinName, char _xyz); 

Test Case

Get acc of X, Y, Z in turn, and print to Serial monitor.

// test for seeed graphical programming project 
// loovee @ 2015-8-4 
#include <Wire.h> 
#include <ADXL345.h> 
 
ADXL345 adxl; 
 
void setup() 
{ 
    adxl.init(); 
    Serial.begin(115200); 
} 
 
void loop() 
{ 
    float ax, ay, az; 
     
    ax = adxl.AxisDigitalAccelerometerRead(5, 'X'); 
    ay = adxl.AxisDigitalAccelerometerRead(5, 'Y'); 
    az = adxl.AxisDigitalAccelerometerRead(5, 'Z'); 
     
    Serial.print(ax, 2); Serial.print('\t'); 
 
    Serial.print(ay, 2); Serial.print('\t'); 
    Serial.println(az, 2); 
     
    delay(20); 
}

This software is written by Loovee for seeed studio
and is licensed under The MIT License. Check License.txt for more information.

Contributing to this software is warmly welcomed. You can do this basically by
forking, committing modifications and then pulling requests (follow the links above
for operating guide). Adding change log and your contact into file header is encouraged.
Thanks for your contribution.

Seeed is a hardware innovation platform for makers to grow inspirations into differentiating products. By working closely with technology providers of all scale, Seeed provides accessible technologies with quality, speed and supply chain knowledge. When prototypes are ready to iterate, Seeed helps productize 1 to 1,000 pcs using in-house engineering, supply chain management and agile manufacture forces. Seeed also team up with incubators, Chinese tech ecosystem, investors and distribution channels to portal Maker startups beyond.

Analytics

seeed_arduino_adxl345's People

Contributors

jiacheng-lu avatar turmary avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

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

Forkers

seeedstuff z2mi

seeed_arduino_adxl345's Issues

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.