Giter VIP home page Giter VIP logo

adafruit_lsm303's Introduction

Warning: Library Deprecated

This library is deprecated, and as of 14 October 2016 this library will no longer appear in the Arduino Library Manager. Any new projects should use the newer library available here: https://github.com/adafruit/Adafruit_LSM303DLHC

Adafruit_LSM303

This is a library for the Adafruit triple-axis accelerometer/magnetometer LSM303DLHC breakout

Designed specifically to work with the Adafruit LSM303 Breakout ----> https://www.adafruit.com/products/1120

These displays use I2C to communicate, 2 pins are required to interface Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Check out the links above for our tutorials and wiring diagrams

Written by Kevin Townsend for Adafruit Industries.
BSD license, all text above must be included in any redistribution

To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_LSM303. Check that the Adafruit_LSM303 folder contains Adafruit_LSM303.cpp and Adafruit_LSM303.h

Place the Adafruit_LSM303 library folder your arduinosketchfolder/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.

Compatibility

MCU Tested Works Doesn't Work Not Tested Notes
Atmega328 @ 16MHz X
Atmega328 @ 12MHz X
Atmega32u4 @ 16MHz X
Atmega32u4 @ 8MHz X
ESP8266 X
Atmega2560 @ 16MHz X SDA/SCL D20/D21
ATSAM3X8E X SDA/SCL D20/D21
ATSAM21D X
ATtiny85 @ 16MHz X
ATtiny85 @ 8MHz X
Intel Curie @ 32MHz X
STM32F2 X
  • ATmega328 @ 16MHz : Arduino UNO, Adafruit Pro Trinket 5V, Adafruit Metro 328, Adafruit Metro Mini
  • ATmega328 @ 12MHz : Adafruit Pro Trinket 3V
  • ATmega32u4 @ 16MHz : Arduino Leonardo, Arduino Micro, Arduino Yun, Teensy 2.0
  • ATmega32u4 @ 8MHz : Adafruit Flora, Bluefruit Micro
  • ESP8266 : Adafruit Huzzah
  • ATmega2560 @ 16MHz : Arduino Mega
  • ATSAM3X8E : Arduino Due
  • ATSAM21D : Arduino Zero, M0 Pro
  • ATtiny85 @ 16MHz : Adafruit Trinket 5V
  • ATtiny85 @ 8MHz : Adafruit Gemma, Arduino Gemma, Adafruit Trinket 3V

adafruit_lsm303's People

Contributors

andydoro avatar ladyada avatar microbuilder avatar tdicola 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

Watchers

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

adafruit_lsm303's Issues

Waiting for 6 bytes are Wire.requestFrom() is not correct.

This line "while (Wire.available() < 6);" is twice in the code and it not correct.
After Wire.requestFrom() the I2C has completely finished and Wire.available() only returns the number of bytes in the buffer.
The return value of Wire.requestFrom() could be checked if 6 bytes are received. But waiting in a while loop to wait for 6 bytes is not correct.

Another Wire.requestFrom() is followed by Wire.endTransmission(). The Wire.endTransmission could (should) be removed.

Wrong bit shift

Hello,

There is a problem whith these lines :

accelData.x = (xlo | (xhi << 8)) >> 4;
accelData.y = (ylo | (yhi << 8)) >> 4;
accelData.z = (zlo | (zhi << 8)) >> 4;

The bit shift of 4 isn't correct.
It's a 12 bits ADC you don't have to do a bit shift on the right ...
If the sensor is at the horizontal you have 0,61 kg/m² instead of 9,80 kg/m² ...
There is a coefficient 16 between the both wich correspond to the bit shift.

Tell me if i'am wrong,
Sincerely yours,
Nicolas Gonzalez

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.