The MPU6050 has 14 sequential registers 0x3B to 0x48 which can be read, register by register serially to retrieve gyro, accelerometer and temperature information. I've had a ongoing niggle that because this is called from Python this 14 individual reads may not be from the same snapshot in time, leading to occasional dodgy values.
I've just stumbled across smbus.read_i2c_block_data() which returns a byte array of a predefined size (lets call is n bytes long). However, the examples / docs I've seen are not helpful / clear.
My question then is whether this byte array is read (under the covers in the smbus driver) as n bytes sequentially from a single register, or if the code steps from register 0x3B thru' 0x48 filling each read byte into the next part of the array. The examples kinda suggest the latter but they or on the murky side.
Anyone got experience of using read_i2c_data_block() in this way?
Last edited by Hove
on Thu Sep 19, 2013 9:45 am, edited 1 time in total.
www.pistuffing.co.uk - Raspberry Pi and other stuffing!