How can i include YAW value in esp8266 code?

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.

#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.YAxis*normAccel.YAxis + normAccel.ZAxis*normAccel.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);
}

Goodluck_:
is it possible to calculate YAW value from both PITCH and ROLL.

No, they're orthogonal. Wouldn't be much point in it if they weren't.

Have you looked at the examples that came with the (mystery) library?

You need a magnetometer or other external reference to measure yaw (usually, the angle relative to North).

The MPU6050 has a three-axis accelerometer which can, when not in free-fall, tell pitch and yaw. It also has a three-axis "rate gyroscope" so it can tell about how fast it is rotating but not what direction it is pointing.

To get yaw you will have to add a three-axis magnetometer. Look for a 9DOF or 10DOF (adds barometric altitude) IMU.

pitch=0
roll=70

why roll==70 (not zero when place in horizontal plane)?

Goodluck_:
why roll==70 (not zero when place in horizontal plane)?

Maybe you math is wrong? Maybe the accelerometer is tilted? Maybe the chip is defective? Not enough info.

The math for roll is correct, if the "normalized" acceleration measurements are correct.

Try using the raw acceleration values instead.

  double x = rawx;
  double y = rawy;
  double z = rawz;
  roll = atan2(y , z) * 57.3;
  pitch = atan2((- x) , sqrt(y * y + z * z)) * 57.3;

where can i get this rawx,rawy,rawz values?

You can presumably get those values using the proper call to the sensor library.

There are several different MPU6050 libraries with identical names, so you have to tell us exactly which one you are using.

i am currently using library :::::::::::::::::::::::::: GitHub - emanbuc/ESP8266_MPU6050: MPU6050 library modified for ESP8266 compatibility

So, open up "MPU6050.h" with a text editor and see what public functions / variables the class makes available. The functions that return a 'Vector' structure look promising.

	Vector readRawAccel(void);