Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sparkfun/sparkfun_lsm303c_6_dof_imu_breakout_arduino_library

Arduino library for SparkFun's LSM303C breakout board.
https://github.com/sparkfun/sparkfun_lsm303c_6_dof_imu_breakout_arduino_library

accelerometer arduino arduino-library magnetometer sensor sparkfun

Last synced: 3 months ago
JSON representation

Arduino library for SparkFun's LSM303C breakout board.

Awesome Lists containing this project

README

        

SparkFun LSM303C 6 DOF IMU Arduino Library
========================================

![LSM303C Breakout](https://cdn.sparkfun.com//assets/parts/1/0/5/6/4/13303-01.jpg)

[*LSM303C Breakout (BOB-13303)*](https://www.sparkfun.com/products/13303)

This is an arduino IDE library to control the LSM303C. It can be configured to use I2C or half-duplex SPI.

This has been tested with Arduino Pro Mini.

Repository Contents
-------------------

* **/examples** - Example sketches for the library (.ino). Run these from the Arduino IDE.
* **/src** - Source files for the library (.cpp, .h).
* **keywords.txt** - Keywords from this library that will be highlighted in the Arduino IDE.
* **library.properties** - General library properties for the Arduino package manager.

Example Briefs
--------------

* MinimalistExample - The **easiest** configuration. Prints out sensor data with some sane default configuration parameters
* ConfigureExample - Same as MinimalistExample, except all of the configuration is exposed with easy to change options all spelled out

Documentation
--------------

* **[Installing an Arduino Library Guide](https://learn.sparkfun.com/tutorials/installing-an-arduino-library)** - Basic information on how to install an Arduino library.
* **[Product Repository](https://github.com/sparkfun/LSM303C_6_DOF_IMU_Breakout)** - Main repository (including hardware files) for the LSM6DS3 Breakout.
* **[Hookup Guide](https://learn.sparkfun.com/tutorials/lsm303c-6dof-hookup-guide)** - Basic hookup guide for the LSM303C Breakout.

Products that use this Library
---------------------------------

* [BOB-13303](https://www.sparkfun.com/products/13339)- LSM303C Breakout board

Version History
---------------

* [V 1.0.2](https://github.com/sparkfun/SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library/releases/tag/V_1.0.2) -- Remove Wire.begin() from library into setup()
* [V 1.0.1](https://github.com/sparkfun/SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library/releases/tag/V_1.0.1) -- Explicitly set the I2C speed for compatibility with faster clocks.
* [V 1.0.0](https://github.com/sparkfun/SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library/releases/tag/V_1.0.0) -- Initial commit of Arduino 1.5+ compatible library.

SparkFun IMU Interface
---
Arduino libraries that implement this interface are guaranteed to to work interchangeably in sketches. If a project is started with 6-DOF IMU, but one realizes that the project really needs a 9-DOF sensor, the change is simple. Include the new header file, & change the type of the IMU object(s). All of the code written to the interface will still function. Here is a list of the functions provided by this interface:
* `status_t begin()` - initialize IMU to sane default values
* `float readGyroX()` - read value from the gyroscope about x-axis
* `float readGyroY()` - read value from the gyroscope about y-axis
* `float readGyroZ()` - read value from the gyroscope about z-axis
* `float readAccelX()` - read value from the accelerometer in x-axis
* `float readAccelY()` - read value from the accelerometer in y-axis
* `float readAccelZ()` - read value from the accelerometer in z-axis
* `float readMagX()` - read value from the magnetometer in x-axis
* `float readMagY()` - read value from the magnetometer in y-axis
* `float readMagZ()` - read value from the magnetometer in z-axis
* `float readTempC()` - read temperature of sensor in ˚C
* `float readTempF()` - read temperature of sensor in ˚F
* `status_t getStatus()` - read the status code of the previous operation

All functions other than `getStatus()` will update the status code depending on how their operation went. Errors in the read functions can be detected by them returning `NAN` or calling `getStatus()`.

If an IMU doesn't support a set of functions, they will always return `NAN` and set the status to `IMU_NOT_SUPPORTED`.

Other, more advanced features may be available depending on the sensor. See the documentation for the particular sensor for information on advanced feature support.

Using as a Template
---

* Create your repo
* pull [/src/SparkFunIMU.h](https://github.com/sparkfun/SparkFun_LSM303C_6_DOF_IMU_Breakout_Arduino_Library/blob/master/src/SparkFunIMU.h) into it

License Information
-------------------

This product is _**open source**_!

Please review the LICENSE.md file for license information.

If you have any questions or concerns on licensing, please contact [email protected].

Distributed as-is; no warranty is given.

- Your friends at SparkFun.