LiquidCGS / FastIMU

the IMU library to rule them all (wip)
MIT License
139 stars 17 forks source link

How to change sample rate #12

Open cenit opened 11 months ago

cenit commented 11 months ago

Hi! First of all, thank you very much for your very versatile library. I tried to search before posting the question, without any luck, but still I fear this is a common question which I am going to ask again... Is there any way to change the sample rate with this library? I'd like to modify the frequency of my MPU6050

LiquidCGS commented 11 months ago

Hey! At the moment changing ODR isn't supported by the library as in most IMU's ODR is also tied to LPF frequencies. You can try changing the sample rate divider on the MPU6050 by editing line 43 in F_MPU6050.c in the lib's files to change the ODR of the gyro from 250hz to 333/500hz/1khz... it's a messy solution that I've got to think a way around solving in the future, probably after FIFO readings are implemented. Cheers.