GithubHelp home page GithubHelp logo

dfrobot_bmx160's Introduction

BMX160-Arduino

The BMX160 is a highly integrated, low power 9-axis sensor that provides precise acceleration and angular rate (gyroscopic) and geomagnetic measurement in each spatial direction.
The BMX160 contains 16 bit digtial,triaxial accelerometer 16 bit digital, triaxial gyroscope and geomagnetic sensor.
This example is for BMX160 sensor and it oprated via Arduino I2C.

DFRobot_BMX160 Library for Arduino


Provide an Arduino library to control the bmx160 to get acell, gyro and step counter, via I2C communication.

Table of Contents

Summary

Provide an Arduino library to control the bmx160 to get magnetometer accelerometer, gyroscope and step counter, via I2C communication.

Installation

To use this library, first download the library file, paste it into the \Arduino\libraries directory, then open the examples folder and run the demo in the folder.

Methods

#include <DFRobot_BMX160.h>
/*
 * @brief set gyroscope angular rate range and resolution.
 */
typedef enum{
 eGyroRange_2000DPS, /*Gyroscope sensitivity at 2000dps*/
 eGyroRange_1000DPS, /*Gyroscope sensitivity at 1000dps*/
 eGyroRange_500DPS,  /*Gyroscope sensitivity at 500dps*/
 eGyroRange_250DPS,  /*Gyroscope sensitivity at 250dps*/
 eGyroRange_125DPS   /*Gyroscope sensitivity at 125dps*/
}eGyroRange_t;

/*
 * @brief allow the selection of the accelerometer g-range.
 */
typedef enum{
 eAccelRange_2G,  /* Macro for mg per LSB at +/- 2g sensitivity (1 LSB = 0.000061035mg) */
 eAccelRange_4G,  /* Macro for mg per LSB at +/- 4g sensitivity (1 LSB = 0.000122070mg) */
 eAccelRange_8G,  /* Macro for mg per LSB at +/- 8g sensitivity (1 LSB = 0.000244141mg) */
 eAccelRange_16G  /* Macro for mg per LSB at +/- 16g sensitivity (1 LSB = 0.000488281mg) */
}eAccelRange_t;

/*
 * @brief reset bmx160 hardware
 * @return true means success
 */
bool softReset();

/*
 * @brief set the i2c addr and init the i2c.
 * @return true means success
 */
bool begin();

/*
 * @brief set gyroscope angular rate range and resolution.
 * @param eGyroRange_t bits in 
 */
void setGyroRange(eGyroRange_t bits);

/*
 * @brief allow the selection of the accelerometer g-range.
 * @param eAccelRange_t bits in 
 */
void setAccelRange(eAccelRange_t bits);

/*
 * @brief get the magn, gyro and accel data 
 * @param pointer to store the data: &Omagn, &Ogyro, &Oaccel.
 */
void getAllData(struct bmx160SensorData *magn, struct bmx160SensorData *gyro, struct bmx160SensorData *accel);

/*
 * @brief disabled the the magn, gyro sensor to reduce power consumption
 */
void setLowPower();

/*
 * @brief enabled the the magn, gyro sensor
 */
void wakeUp();

Compatibility

MCU Work Well Work Wrong Untested Remarks
Arduino uno
Mega2560
Leonardo
ESP32

History

  • data 2019-6-25
  • version V0.1

Credits

Written by([email protected]), 2019. (Welcome to our website)

dfrobot_bmx160's People

Contributors

luoyufenglalala 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.