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.