Hi,
Just bought the AltIMU-10 v3 to connect with my Beaglebone.
Everything works fine so far, but I am stuck with one point. I was expecting much faster reading (I would need around 200Hz)… The results I have currently are around 20ms between two readings. I am wondering if this comes from a wrong register parameter or from something else (I2C bus parameter [which is currently working at 100kHz]) ?
Here below is my Python script (example for the LSM303D):
import commands
import datetime
# Compass LSM303D (accelerometer and magnetometer)
print "Client started ..."
print "i2cdetect -r -y 1"
print commands.getoutput("i2cdetect -r -y 1")
print "Attempt to connect to the Compass..."
x = commands.getoutput("i2cget -y 1 0x1D 0x0F b")
if x == '0x49':
print "Beagle Bone is connected with the Compass"
else:
print "Cannot connect to the Compass"
commands.getoutput("i2cset -y 1 0x1D 0x21 0x00 b") #CTRL2
# magnetic sensor into continuous mode from sleep mode
commands.getoutput("i2cset -y 1 0x1D 0x20 0x57 b") #CTRL1 0x57
# ctrl5 parameter
commands.getoutput("i2cset -y 1 0x1D 0x24 0x64") #CTRL5
commands.getoutput("i2cset -y 1 0x1D 0x25 0x20") #CTRL6
commands.getoutput("i2cset -y 1 0x1D 0x26 0x00") #CTRL7
while True:
time_1 = datetime.datetime.now()
#read x-axis accelerometer
x = commands.getoutput("i2cget -y 1 0x1D 0x28 b") #Low
time_2 = datetime.datetime.now()
print "int : "+str(time_2 - time_1)
Thanks;