You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You perform no less than 6 read operations in consequtive addresses from address 17 through 22. Your device must respond to each one of these separately, and that takes time and resources for your sensor to process. Why not try to do all reads in one go instead of 6? Be kind to your sensor whenever possible :)
Why don't you try to follow Example #2 in the readme? In your case, that should be something like (not tested - I don't have this sensor):
# Read 6 bytes starting at index 17buf=i2c_bus.read_i2c_block_data(i2c_magnetometer_register, 17, 6) # data is now a list/array# Convert to 16 bit worddatax=buf[1] <<8+buf[0]
If this doesn't work, you should at least try to read 3 words instead of 6 bytes. Rules of thumb:
I am reading data from a IST8308 IMU sensor with this script on a Linux Arm64 board:
the
read_byte_data()
function is very slow (in particular, the builtinioctl()
call inread_byte_data()
). Is it a sensor problem, or a smbus2 problem?The text was updated successfully, but these errors were encountered: