01-25-2024 11:57 PM
Hello, I'm new to I2C and recently struggling to read data using MPU-6050.
At first, I tested with arduino LINX and it worked easily. Now I got a USB-8452 and it's getting weird.
I searched for Labview and Arduino forum and still confused. I need some help.
1. Addressing problem. Shift or not?
https://forums.ni.com/t5/LabVIEW/NI-845X-I2C-communication-example/td-p/3585049
In forum search, crossrulz pointed out that device address should be shifted to right by 1 bit in block diagrams.
Default address of MPU-6050 is 0x68 (104) and should be 0x34 (52) when shifted. However when I set the address 0x34, I get -301742 error. Just using 0x68 seems fine. At least I don't have error messages and can read something then.
2. No measurements
I read MPU-6050 register map documents and it seems I should read register 0x3B (59) to 0x48 (71) for sensor measurements. However when I designate to read 14 bytes from address 59, I only get zeros. Shifting the address did the same.
As I read from forum, I need to use write-read function to read from specific register address, like below:
Seems reading from specific register is working, however writing some value to the specific register isn't. For example, I tried to give some random value at index 1, but readings are still all zero.
I'm really confused. What am I missing?