pimoroni / icm20948-python

Python library for the Pimoroni ICM20948 breakout
https://shop.pimoroni.com/products/icm20948
MIT License
48 stars 22 forks source link

Fix pwr mgmt for magnetometer #7

Closed leosh64 closed 4 years ago

leosh64 commented 4 years ago

The original C code supplied by Waveshare with their IMX219-83 stereo camera including an icm20948 9dof sensor includes this additional write for power management. Without it, the magnetometer won't be ready on the waveshare device: It'll be stuck at while not self.magnetometer_ready() forever.

Moreover, the fix by @Gadgetoid makes the magnetometer output meaningful data. Applying the power management fix to current master (without the changes in branch patch-mag-io), there is data from the magnetometer, but it sometimes (approximately once per second) spikes to values 1000 times higher than before.

Thus it seems both fixes are necessary to get the Waveshare sensor work.

Gadgetoid commented 4 years ago

Merged in https://github.com/pimoroni/icm20948-python/commit/09564a0e880ab08b7de381af68055edffff44749 but apparently had some sort of Git hiccup.

Thanks again!