Use a gyro/accelerometer with Arduino [closed]

asked 2015-12-09 02:28:05 -0600

Hakan Bey gravatar image

Hi guys, I am working on the project Accelerometer. I used= Arduino IDE 1.5 and GY 521 accelometer. But library does not see the MP 6050. I got the address library https://github.com/jrowberg/i2cdevlib... .

And I received Error: "sketch_dec09a.ino:3: fatal error: MPU6050.h: No such file or directory compilation terminated."

Me code;

> #include <Servo.h>
> #include <Wire.h>
> #include <I2Cdev.h>
> #include <MPU6050.h>
> 
> MPU6050 mpu;
> 
> int16_t ax, ay, az; int16_t gx, gy,
> gz;
> 
> Servo myservoY; Servo myservoX;
> 
> int valY; int prevValY;
> 
> int valX; int prevValX;
> 
> void setup()  {   Wire.begin();  
> Serial.begin(38400);  
> Serial.println("Initialize MPU");  
> mpu.initialize();  
> Serial.println(mpu.testConnection() ?
> "Connected" : "Connection failed");  
> myservoY.attach(9);  
> myservoX.attach(10); } void loop()  { 
> mpu.getMotion6(&ax, &ay, &az, &gx,
> &gy, &gz);   valY = map(ay, -17000,
> 17000, 0, 179);   valX = map(ax,
> -17000, 17000, 0, 179);   if (valY != prevValY)   {
>     myservoY.write(valY);
>     prevValY = valY;   }
> 
>   if (valX != prevValX)   {
>     myservoX.write(valX);
>     prevValX = valX;   }   delay(50); }
edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant. Please see http://wiki.ros.org/Support for more details. by Akif
close date 2015-12-09 04:01:06.069981

Comments

This question is not related with ROS. It is an Arduino topic. Therefore please ask this question on Arduino related boards (like https://forum.arduino.cc/ ). If you think that it is related with ROS please clearify.

Akif gravatar image Akif  ( 2015-12-09 04:02:55 -0600 )edit

Akif Meraba, sordum oraya da net bir cevap gelmedi buraya yönlendirdi bi iki arakdaşda ondan dolayı sordum.

Hakan Bey gravatar image Hakan Bey  ( 2015-12-09 05:47:19 -0600 )edit