emanbuc / esp8266_mpu6050 Goto Github PK
View Code? Open in Web Editor NEWMPU6050 library modified for ESP8266 compatibility
License: GNU General Public License v3.0
MPU6050 library modified for ESP8266 compatibility
License: GNU General Public License v3.0
I have esp8266 ic with MPU6050 .
i am use a github librery to connect both the modules
its work well for displaying PITCH and ROLL but its not display the YAW value.
How can i include YAW value in this code?
is it possible to calculate YAW value from both PITCH and ROLL.
The code is given below
`#include <Wire.h>
#include <ESP8266WiFi.h>
#include <MPU6050.h>
MPU6050 mpu;
int SCL_PIN=D1;
int SDA_PIN=D2;
void setup()
{
WiFi.forceSleepBegin();// turn off ESP8266 RF
delay(1);
Serial.begin(9600);
Serial.println("Initialize MPU6050");
while(!mpu.beginSoftwareI2C(SCL_PIN,SDA_PIN,MPU6050_SCALE_2000DPS, MPU6050_RANGE_2G))
{
Serial.println("Could not find a valid MPU6050 sensor, check wiring!");
delay(500);
}
}
void loop()
{
// Read normalized values
Vector normAccel = mpu.readNormalizeAccel();
// Calculate Pitch & Roll
int pitch = -(atan2(normAccel.XAxis, sqrt(normAccel.YAxisnormAccel.YAxis + normAccel.ZAxisnormAccel.ZAxis))*180.0)/M_PI;
int roll = (atan2(normAccel.YAxis, normAccel.ZAxis)*180.0)/M_PI;
// Output
Serial.print(" Pitch = ");
Serial.print(pitch);
Serial.print(" Roll = ");
Serial.print(roll);
Serial.println();
delay(10);
}`
I am using MP6050 with ESP12F. I have connected vcc, gnd, i2c in D1 and D2, and INT in D7 in ESP12F, but the code doesn't interrupt in case of fall detection. I need help.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.