astro-pi / python-sense-hat

Source code for Sense HAT Python library
https://sense-hat.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
505 stars 253 forks source link

Changing parameters in RTIMULib.ini has no effect on sensor read / poll rate #111

Open edbird opened 3 years ago

edbird commented 3 years ago

Just as stated in the title, I have tried editing a copy of RTIMULib.ini (which is in my current working directory) and the values of the parameters in this file appear to have no effect on the SenseHAT sensors poll rate.

I suspect rather than this being a bug in the Python SenseHAT library, this might be due to me misunderstanding how to set these parameters.

Some questions:

Does a python script look in the current working directory for the file RTIMULib.ini ?

Does a python script read this file and try to set the values for the SenseHAT sensors using the values contained in this file?

Reason for asking: It is possible that only the C/C++ implementations which use RTIMU read this file. (But seems unlikely?)

edbird commented 3 years ago

Further info: The SenseHAT uses the LSM9DS1 chip for acceleration, angular rotation velocity and magnetic field sensor measurements.

I have written a Python script to repeatedly read the accelerometer. The maximum rate I am able to obtain is about 50 - 60 Hz, whereas this sensor should have a maximuim sample rate of 1 kHz.

I have tried playing around with the relevant values in RTIMULib.ini under the section for LSM9DS1, but I cannot get anything higher than this 50 - 60 Hz. Situation is even worse when reading other sensors as well, with maximum rates being about 20 Hz.

edbird commented 3 years ago

I also tried playing around with the provided C++ examples, but found the same behaviour. I know for certain that the C++ codes read the RTIMULib.ini file, but again changing the values seems to have no effect.

Bizzare. Can anyone help or offer any advice? Like I say it might not be a bug - this might be me misunderstanding something.