adafruit / Adafruit_CircuitPython_LIS3MDL

CircuitPython helper library for the LIS3MDL 3-axis magnetometer
MIT License
11 stars 8 forks source link

Throttled Data Rate #24

Open NotAPlumber opened 1 year ago

NotAPlumber commented 1 year ago

Hey, I'm running this code on a Windows 11 PC in a Jupyter Notebook, and my data rate seems to be limited to about 11 Hz (for the read/write cycle). Is this expected behavior for the interface? Can I speed it up somehow? Thanks Code below

data_rate is 155.0 HZ performance_mode is Ultra-high Performance

import time
tic = time.time()
mag_x, mag_y, mag_z = sensor.magnetic
toc = time.time()
elapsed_time = toc - tic
print(1/elapsed_time)

11.886292080063706

tekktrik commented 1 year ago

Based on your explanation of the setup, are you using Blinka with the FT232H? I don't know what the overhead to use Blinka + FT232H on performance, but profiling that may yield more information on what exactly is taking up that time, but if you are using the setup describe other things behind the scenes may be using that time.