You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noted an issue though which of course might be a hardware issue but anyway I would like to share it. Hopefully it helps. Please note that this might be an hardware issue and I am also not an I2C expert.
I noticed that my code froze when I was using the sleep() and wake() commands, perhaps this has to do with using other I2C devices as well.
I made the following changes to fix this.
I commented the code on lines 282, 283, and 284 at line 279, the chip goes to sleep without them anyway.
I change line 290 to: _i2cPort->endTransmission(false); // stop i2c bus transmission BEFORE sending wake up request
so instead of setting true, I set false.
I commented line 302 and instead added the code below (I don't think the delay is needed). The reason is, that the wake up command seems to interfere with the normal I2C operation and on my device (a feather M0) the only way to reset it was calling begin again. delay(10); _i2cPort->begin();
When the sensor is a sleep and you reset your program without powering down, begin will always return false. So it is not a bad idea upon begin try to wake the sensor if begin returns false. I added a member variable 'bool isResetOnBegin;" (you will probably prefer _isResetOnBegin). Then I do the following to try and wake once:
` bool beginSuccess = isConnected();
if(!beginSuccess && !isResetOnBegin)
{
wake();
isResetOnBegin = true;;
}
return beginSuccess;
`
Hope this information helps other people!
The text was updated successfully, but these errors were encountered:
Thanks for this library, works nicely!
I noted an issue though which of course might be a hardware issue but anyway I would like to share it. Hopefully it helps. Please note that this might be an hardware issue and I am also not an I2C expert.
I noticed that my code froze when I was using the sleep() and wake() commands, perhaps this has to do with using other I2C devices as well.
I made the following changes to fix this.
I commented the code on lines 282, 283, and 284 at line 279, the chip goes to sleep without them anyway.
I change line 290 to:
_i2cPort->endTransmission(false); // stop i2c bus transmission BEFORE sending wake up request
so instead of setting true, I set false.
I commented line 302 and instead added the code below (I don't think the delay is needed). The reason is, that the wake up command seems to interfere with the normal I2C operation and on my device (a feather M0) the only way to reset it was calling begin again.
delay(10); _i2cPort->begin();
When the sensor is a sleep and you reset your program without powering down, begin will always return false. So it is not a bad idea upon begin try to wake the sensor if begin returns false. I added a member variable 'bool isResetOnBegin;" (you will probably prefer _isResetOnBegin). Then I do the following to try and wake once:
` bool beginSuccess = isConnected();
if(!beginSuccess && !isResetOnBegin)
{
wake();
isResetOnBegin = true;;
}
return beginSuccess;
`
Hope this information helps other people!
The text was updated successfully, but these errors were encountered: