GithubHelp home page GithubHelp logo

bekspace / lolin_d1_mini-mpu6050 Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 2.0 382 KB

Measure angles using mpu6050 on Lolin (Wemos) D1 mini, esp8266

C++ 100.00%
wemos-d1-mini lolin-d1-mini esp8266 mpu6050

lolin_d1_mini-mpu6050's Introduction

lolin_d1_mini-mpu6050

Measure angles using mpu6050 on Lolin (Wemos) D1 mini, esp8266

While there are many resources available on the internet for Arduino Uno development boards, I couldn't find any instructions for Wemos D1 mini. I myself struggled to get wemos d1 mini working with MPU6050, so I'm sure this tutorial will be helpful for some folks.

Connection is very straightforward:

Wemos D1 mini MPU6050
3.3V VCC
GND GND
D3 (pin 0) SDA
D4 (pin 2) SCL

Like here: pinout schematic

Make sure to explicitly specify pins 0 (D3) and 2 (D4) to be used for I2C communication inside the code.

Wire.begin(0,2)

Overview of the code:

  • Setup function

    1. Setup I2C connection using Wire Library
    2. Start the timer
  • Loop function

    1. Calculate the elapsed time since last execution start of loop function
    2. Read raw accelerometer data from mpu6050
    3. Convert the raw accelerometer data to acceleration angles using Euler's formula
    4. Read raw gyroscope data from mpu6050
    5. Convert gyroscope data to degrees/seconds
    6. Calculate the total angle using data from gyroscope and accelerometer

Full tutorial may be found here

lolin_d1_mini-mpu6050's People

Contributors

bekspace avatar

Stargazers

 avatar  avatar  avatar

Forkers

dexif rmnarj

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.