Hello,
I would like to compute the angle of the knee when walking. Therefore I am using two ICM20948 IMU sensors (one at the thigh and one at the shank). Since the two sensors have the same address, I am using a Mux Breakout TCA9548A to read from both of them.
I wrote the following code however the sampling rate is really slow already without inserting any delay (approx. 80-90 Hz). Is there a way to make the reading of both sensors more efficient?
I really thank you for your attention.
Best regards.
test = qwiic.QwiicTCA9548A()
test.disable_all()
test.enable_channels([0])
IMU = qwiic.create_device('QwiicIcm20948')
if IMU.connected == False:
print("The Qwiic ICM20948 device isn't connected to the system. Please check your connection", \
file=sys.stderr)
else:
IMU.begin()
test.disable_channels([0])
while True:
test.enable_channels([0])
if IMU.dataReady():
IMU.getAgmt()
test.disable_channels([0])
test.enable_channels([1])
if IMU.dataReady():
IMU.getAgmt()
test.disable_channels([1])