Go Down

Topic: NODEMCU lolin v3 and MPU6050 (Read 40 times) previous topic - next topic

abhi83166

Mar 27, 2019, 10:16 am Last Edit: Mar 27, 2019, 10:17 am by abhi83166
Trying to Make MPU6050 and NODEMCU lolin V3work with MPU6050_tockn library....
getting same error basically the results are showing 135degree all the time for all values .

#include <MPU6050_tockn.h>
#include <Wire.h>

MPU6050 mpu6050(Wire);

void setup() {
  Serial.begin(9600);
  Wire.begin(0,2);
  mpu6050.begin();
  mpu6050.calcGyroOffsets(true);
}

void loop() {
  mpu6050.update();
  Serial.print("angleX : ");
  Serial.print(mpu6050.getAngleX());
  Serial.print("\tangleY : ");
  Serial.print(mpu6050.getAngleY());
  Serial.print("\tangleZ : ");
  Serial.println(mpu6050.getAngleZ());
}

Go Up