0

I use the MPU6050 device and get accelerometer and gyroscope data.
Now I need to read a block of data from the MPU6050 using cpp language.

It was easy to do this in Python:

data_tmp = bus.read_i2c_block_data(Device_Address, ACCEL_XOUT_H, 14)

This function reads a block of data (14 bytes) starting from address ACCEL_XOUT_H.
And how to do the same in cpp ? Should I use this function:

i2c_smbus_read_i2c_block_data(int file, __u8 command, __u8 length, __u8 *values)

If YES, explain me how should I use it.
If NO, write me an example, please.

Natal04ka
  • 45
  • 6
  • `i2c_smbus_read_block_data` -- What does [the documentation](https://docs.huihoo.com/linux/kernel/2.6.26/kernel-api/re1222.html) say? – PaulMcKenzie Feb 26 '20 at 15:18
  • @PaulMcKenzie - This command reads a block of bytes from a device, from a designated register that is specified through the Comm byte. – Natal04ka Feb 26 '20 at 15:44

0 Answers0