about mpu6050

//

I started to use mpu6050 without any mpu library

Why? Did you make your own Arduino from a pile of silicon and copper? Did you make your own MPU6050 from a pile of silicon and copper? Did you write your own IDE? Compiler?

Base_Raw_Acc_X += Wire.read()<<8|Wire.read();

What type does Wire.read() return? What happens when you shift that type 8 bits to the left?

PaulS:
Why? Did you make your own Arduino from a pile of silicon and copper? Did you make your own MPU6050 from a pile of silicon and copper? Did you write your own IDE? Compiler?

Base_Raw_Acc_X += Wire.read()<<8|Wire.read();

What type does Wire.read() return? What happens when you shift that type 8 bits to the left?

Because with library fifty percent of memory is being used. But with my code you can get pitch and roll values with using only 28 per cent memory. I am using nano Arduino.

Why are you so mad about it? I think you gave money to flight controller boards so much :slight_smile:

mustafagokce09:
Because with library fifty percent of memory is being used. But with my code you can get pitch and roll values with using only 28 per cent memory.

So? It would still work if you used 99% of memory.

Getting values from Mpu 6050 will be the smallest part of my code. On same nano I will also make GPS reading bmp reading and wireless reading and sending. So I should write all of them with lowest system requirements as possible.
Best regards....

Because with library fifty percent of memory is being used. But with my code you can get pitch and roll values with using only 28 per cent memory. I am using nano Arduino.

On the other hand, your code doesn't work. Maybe the library does do something useful, after all.

PaulS:
On the other hand, your code doesn't work. Maybe the library does do something useful, after all.

I write my problem here to find an answer. If don't know than please kindly don't answer. You are wasting my time.

You are wasting my time.

And you are wasting ours. The FIRST thing to do is to verify that your hardware works by running the sample that comes with the library.

If it does, then YOU look at the library to see how it PROPERLY does whatever it is you are doing wrong.

I gave you one hint that you ignored.

Is your problem here?

 Flt_X_Deg = Alpha*Flt_Gyr_X + (1-Alpha)*Acc_X;
  Flt_Y_Deg = Alpha*Flt_Gyr_Y + (1-Alpha)*Acc_Y;
  Flt_Z_Deg = Flt_Gyr_Z;

...and yes, you should verify the hardware with known good code.

aarg:
Is your problem here?

 Flt_X_Deg = Alpha*Flt_Gyr_X + (1-Alpha)*Acc_X;

Flt_Y_Deg = Alpha*Flt_Gyr_Y + (1-Alpha)*Acc_Y;
  Flt_Z_Deg = Flt_Gyr_Z;




...and yes, you should verify the hardware with known good code.

Hello there :slight_smile:
Yes I tested the module with proper code and it's working. there is only the filtered z angle wrong.