Hi. I'm new to the embedded world. I have a LPCXpresso802 Board and an accelerometer MPU6050.
I want to read data from Mpu6050 using I2C. I use LPCOpen Lib but I don't understand that well. I was able to connect with him but I guess I don't extract the data from where I need. I modified this code to read data from 0x68 because I know that is MPU6050 access register.
#define MPU_I2CAddress 0x68
Ok, I make changes. I read Who Am I register(75) and he return me value 68, witch is good.
But when I try to read the temperature returns 0, why?
REG FOR TEM IS : 0X41-> TEMP_OUT_H
0X42-> TEMP_OUT_L
Hi Mihai Robu,
If you can read Who Am I register, it means the hardware connection don't have the problem.
I think the temperature read have problem still in the code side, you need to check the I2C bus wave, check whether the control I2C wave meet your MPU6050 read register demand? Maybe the control step have the problem. You can associated with the logical analyzer to check the I2C wave, this will be more easy to find the problem, after you get the I2C wave, check it with your MPU6050 datasheet read temperature wave.
About the MPU6050, I find there has a post on the website may help you:
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------