-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Hi @LiquidCGS, thanks for making this library. It's been a big help making my IMU code work across multiple devices.
I'm currently using a LSM6DSL IMU and I'm encountering two issues with it:
-
I'm initialize the IMU very quickly after booting, and apparently sometimes the device isn't ready yet. The call to
readByte(IMUAddress, LSM6DSL_WHO_AM_I)returns nothing. I can fix this problem by adding adelay(500)before callingLSM6DSL::init(). However, this is undesirable since I want a very fast boot time. -
When the device does init successfully,
LSM6DSL::init()contains its owndelay(100)that adds unnecessary waiting and delay. According to the LSM6DSL specifications (page 49), a soft boot call only should take 50 nanoseconds:
The SW_RESET procedure can take 50 μs; the status of reset is signaled by the status of the SW_RESET bit of the CTRL3_C register
What I would like to propose to hopefully solve both problems is that a while() loop be introduced to check if the device is ready, rather than either assuming the device is already ready when init() is called, and then check if the device is ready after executing a soft reset, rather than hard-coding a delay. I'll see about filing a PR.