I am trying to replicate a earthquake monitering project from the link: Earthquake Detector using Arduino and MPU-6050
The error is : "Class MPU6050 has no member named 'begin'" and "Multiple libraries found for MPU6050.h"
I have already prepared the physcal setup of the project but am having a lot of trouble with the code. I am very new to this and hence cant figure our how to solve this problem. I looked for other MPU6050.h that may be in my computer but was unable to find a duplicate. Even in the long form of the error, which someone said would have the location of the unused file under "Not used" but i couldnt find thar in the verbose error message. So i cant figure out which files i need to remove.
The link to the pictures of the folder items and the keywords.txt:
The errror message:
Multiple libraries were found for "LiquidCrystal.h"
Used: /Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal
Multiple libraries were found for "Wire.h"
Used: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire
Multiple libraries were found for "MPU6050.h"
Used: /Users/dev/Documents/Arduino/libraries/MPU6050
Using library LiquidCrystal at version 1.0.7 in folder: /Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal
Using library Wire at version 1.0 in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/Wire
Using library MPU6050 at version 0.0.2 in folder: /Users/dev/Documents/Arduino/libraries/MPU6050
exit status 1
'class MPU6050' has no member named 'begin'
I suspected that i had it in both the Java/libraries and the Documents/Libraries, but that was not the case after i cheacked for it. What should i remove? Somewhere it said that i had to remove the "9-axis" file but doing that changed nothing.
#include <LiquidCrystal.h>
#include <Wire.h>
#include <MPU6050.h>
#define minval -5
#define maxval 3
MPU6050 mpu;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{ lcd.begin(16, 2);
Serial.begin(115200);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
lcd.print(" EarthQuake ");
lcd.setCursor(0, 1);
lcd.print(" Detector");
delay (2000);
lcd.clear();
// Initialize MPU6050
Serial.println("Initialize MPU6050");
while(!mpu.begin(MPU6050_SCALE_2000DPS, MPU6050_RANGE_2G))
{ Serial.println("Could not find a valid MPU6050 sensor, check wiring!");
delay(500);}
mpu.setThreshold(3);
// Check settings
checkSettings();
}
void checkSettings()
{
Serial.println();
Serial.print(" * Sleep Mode: ");
Serial.println(mpu.getSleepEnabled() ? "Enabled" : "Disabled");
Serial.print(" * Clock Source: ");
switch(mpu.getClockSource())
{case MPU6050_CLOCK_KEEP_RESET: Serial.println("Stops the clock and keeps the timing generator in reset"); break;
case MPU6050_CLOCK_EXTERNAL_19MHZ: Serial.println("PLL with external 19.2MHz reference"); break;
case MPU6050_CLOCK_EXTERNAL_32KHZ: Serial.println("PLL with external 32.768kHz reference"); break;
case MPU6050_CLOCK_PLL_ZGYRO: Serial.println("PLL with Z axis gyroscope reference"); break;
case MPU6050_CLOCK_PLL_YGYRO: Serial.println("PLL with Y axis gyroscope reference"); break;
case MPU6050_CLOCK_PLL_XGYRO: Serial.println("PLL with X axis gyroscope reference"); break;
case MPU6050_CLOCK_INTERNAL_8MHZ: Serial.println("Internal 8MHz oscillator"); break;
}
Serial.print(" * Gyroscope: ");
switch(mpu.getScale))
{case MPU6050_SCALE_2000DPS: Serial.println("2000 dps"); break;
case MPU6050_SCALE_1000DPS: Serial.println("1000 dps"); break;
case MPU6050_SCALE_500DPS: Serial.println("500 dps"); break;
case MPU6050_SCALE_250DPS: Serial.println("250 dps"); break:}
Serial.print(" * Gyroscope offsets: ");
Serial.print(mpu.getGyroOffsetX());
Serial.print(" / ");
Serial.print(mpu.getGyroOffsetY());
Serial.print(" / ");
Serial.println(mpu.getGyroOffsetZ());
Serial.println();}
void loop()
{ Vector rawGyro = mpu.readRawGyro();
Vector normGyro = mpu.readNormalizeGyro();
Serial.print(" Xraw = ");
Serial.print(rawGyro.XAxis);
Serial.print(" Yraw = ");
Serial.print(rawGyro.YAxis);
Serial.print(" Zraw = ");
Serial.println(rawGyro.ZAxis);
if(normGyro.XAxis > maxval || normGyro.XAxis < minval && normGyro.YAxis > maxval || normGyro.YAxis < minval && normGyro.ZAxis > maxval || normGyro.ZAxis < minval)
{ digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(300);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
delay(300);
lcd.clear();
lcd.print("***EarthQuake***");
delay (1000);
lcd.clear();}
else{digitalWrite(7,LOW);
digitalWrite(8,LOW);}
Serial.print(" Xnorm = ");
Serial.print(normGyro.XAxis);
Serial.print(" Ynorm = ");
Serial.print(normGyro.YAxis);
Serial.print(" Znorm = ");
Serial.println(normGyro.ZAxis);
delay(10);}