All Projects → asukiaaa → MPU9250_asukiaaa

asukiaaa / MPU9250_asukiaaa

Licence: MIT license
A library for arduino to read value of MPU9250.

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to MPU9250 asukiaaa

MPU-9250-Sensors-Data-Collect
MPU9250 (MPU6500 + AK8963) I2C Driver in Python for Raspbery PI
Stars: ✭ 51 (-26.09%)
Mutual labels:  magnetometer, accelerometer, mpu9250
GY-85
Arduino implementation for GY-85 (ADXL345 accelerometer, ITG3200 gyroscope and HMC5883L magnetometer)
Stars: ✭ 63 (-8.7%)
Mutual labels:  magnetometer, accelerometer
dana
DANA: Dimension-Adaptive Neural Architecture (UbiComp'21)( ACM IMWUT)
Stars: ✭ 28 (-59.42%)
Mutual labels:  magnetometer, accelerometer
pymetawear
Community developed SDK around the Python bindings for the C++ SDK
Stars: ✭ 42 (-39.13%)
Mutual labels:  magnetometer, accelerometer
ios logger
Application for camera and sensor data logging (iOS)
Stars: ✭ 60 (-13.04%)
Mutual labels:  magnetometer, accelerometer
imusensor
Python library for communication between raspberry pi and MPU9250 imu
Stars: ✭ 47 (-31.88%)
Mutual labels:  accelerometer, mpu9250
LaunchPadFlightController
TM4C123G based Flight Controller
Stars: ✭ 62 (-10.14%)
Mutual labels:  magnetometer, accelerometer
compass-react-native-expo
A simple compass app built with expo & react-native. Non-expo version - https://github.com/rahulhaque/compass-react-native
Stars: ✭ 37 (-46.38%)
Mutual labels:  magnetometer
COVID-away
Repo of paper title 'Avoid touching your face: A hand-to-face 3d motion dataset (covid-away) and trained models for smartwatches'
Stars: ✭ 18 (-73.91%)
Mutual labels:  accelerometer
sensormotion
Package for analyzing human motion data (e.g. PA, gait)
Stars: ✭ 73 (+5.8%)
Mutual labels:  accelerometer
CodeDroneDIY
The most simple, but working, quadricopter flight controller from scratch, using Arduino Uno/Nano.
Stars: ✭ 68 (-1.45%)
Mutual labels:  accelerometer
TLV493D-A1B6-3DMagnetic-Sensor
Library for the TLV493D-A1B6 3D magnetic sensor for Arduino.
Stars: ✭ 27 (-60.87%)
Mutual labels:  magnetometer
RaspberryPilot
RaspberryPilot
Stars: ✭ 31 (-55.07%)
Mutual labels:  mpu9250
hoverboard-sideboard-hack-GD
Hoverboard sideboard hack for GD32 boards
Stars: ✭ 68 (-1.45%)
Mutual labels:  accelerometer
adxl345
ADXL345 full function driver for general MCU and Linux.
Stars: ✭ 170 (+146.38%)
Mutual labels:  accelerometer
AndrOBD-Plugin
AndrOBD plugin development project
Stars: ✭ 38 (-44.93%)
Mutual labels:  accelerometer
SparkFun MMA8452Q Arduino Library
SparkFun Triple Axis Accelerometer Breakout - MMA8452Q Arduino Library
Stars: ✭ 16 (-76.81%)
Mutual labels:  accelerometer
Excuser
An Android app which trigger a fake call on the device, just by shaking android wear on your wrist.
Stars: ✭ 25 (-63.77%)
Mutual labels:  accelerometer
InterfaceInteraction
Interact your app's interface elements with different effects!
Stars: ✭ 57 (-17.39%)
Mutual labels:  accelerometer
GRT-iOS-HelloWorld
An example of how to integrate the Gesture Recognition Toolkit into an iPhone app
Stars: ✭ 34 (-50.72%)
Mutual labels:  accelerometer

MPU9250_asukiaaa Build Status

A library to read values from MPU9250.

Installation

You can install to Arduino IDE with using library manager.

  1. Select [Sketch -> Include Library -> Manage Libraries] to open library manager.
  2. Search MPU9250 in library manager.
  3. Select and install this project.

Connection

For uno, nano and so on.

Arduino MPU9250
3.3 VCC
A4(SDA) SDA
A5(SCL) SCL
GND GND

For other boards, please check i2c pin assign.

Usage

You can see all function on example project.

Accelerometer

#include <MPU9250_asukiaaa.h>
MPU9250_asukiaaa mySensor;
float aX, aY, aZ, aSqrt;

void setup() {
  Wire.begin();
  mySensor.setWire(&Wire);
  mySensor.beginAccel();
}

void loop() {
  mySensor.accelUpdate();
  aX = mySensor.accelX();
  aY = mySensor.accelY();
  aZ = mySensor.accelZ();
  aSqrt = mySensor.accelSqrt();
  // Do what you want
}

Gyrometer

#include <MPU9250_asukiaaa.h>
MPU9250_asukiaaa mySensor;
float gX, gY, gZ;

void setup() {
  Wire.begin();
  mySensor.setWire(&Wire);
  mySensor.beginGyro();
}

void loop() {
  mySensor.gyroUpdate();
  gX = mySensor.gyroX();
  gY = mySensor.gyroY();
  gZ = mySensor.gyroZ();
  // Do what you want
}

Magnetometer

#include <MPU9250_asukiaaa.h>
MPU9250_asukiaaa mySensor;
float mDirection;
uint16_t mX, mY, mZ;

void setup() {
  Wire.begin();
  mySensor.setWire(&Wire);
  mySensor.beginMag();
}

void loop() {
  Serial.begin(115200);
  mySensor.magUpdate();
  mX = mySensor.magX();
  mY = mySensor.magY();
  mZ = mySensor.magZ();
  mDirection = mySensor.magHorizDirection();
  // Do what you want
}

If you get values of sensor like this..

Name Max Min
magX 70 -30
maxY 110 10

You can calcurate offset values like this.

maxXOffset = - (magXMax + magXMin) / 2
           = - (70 - 30) / 2
           = - 40 / 2
           = -20
magYOffset = - (magYMax + magYMin) / 2
           = - (110 + 10) / 2
           = - 120 / 2
           = -60

Then set the offset values like this.

void setup() {
  mySensor.magXOffset = -20;
  mySensor.magYOffset = -60;
}

Then you can get like this.

Name Max Min
magX 50 -50
maxY 50 -50

After setting offset value, you can get magHorizDirection as you expected.

Warning: Offset value changes by temperature or some reason. If you want to get high accuracy value, you should recheck the offset value.

Example about auto calibration (calculating offset values) is here.

With customizable Wire

For ESP32 and so on.

#define SDA_PIN 21
#define SCL_PIN 22

void setup() {
  Wire.begin(SDA_PIN, SCL_PIN);
  mySensor.setWire(&Wire);
}

License

MIT

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].