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 struggle to make the library working with 2 modules.
At the startup of my application, sometime it's working, sometime not, or it's simply hanging.
Then i realized it seems that in the begin() function, the first time we call the update() function, preInterval = 0, and it's compared to millis() to calculate the value of dt.
Depending on the order of the things you initialize in your application setup() function, the first time the millis() function will be called might give you a pretty big number, which will then enter loops in the wrap() function.
The second module will be even greater, since it waits for the first ont to complete.
I noticed you initialize that variable after the update(), which is kinda weird since it's already set in the update() method itself.
this->update();
angleX = this->getAccAngleX();
angleY = this->getAccAngleY();
preInterval = millis(); // may cause lack of angular accuracy if begin() is much before the first update()
return status;
Would it be okay to initialize the variable before update() instead of after?
I'm not quite sure what it is for, but i know it's what slows me down.
The text was updated successfully, but these errors were encountered:
I struggle to make the library working with 2 modules.
At the startup of my application, sometime it's working, sometime not, or it's simply hanging.
Then i realized it seems that in the
begin()
function, the first time we call theupdate()
function,preInterval = 0
, and it's compared tomillis()
to calculate the value ofdt
.Depending on the order of the things you initialize in your application
setup() function
, the first time themillis()
function will be called might give you a pretty big number, which will then enter loops in thewrap()
function.The second module will be even greater, since it waits for the first ont to complete.
I noticed you initialize that variable after the update(), which is kinda weird since it's already set in the update() method itself.
Would it be okay to initialize the variable before update() instead of after?
I'm not quite sure what it is for, but i know it's what slows me down.
The text was updated successfully, but these errors were encountered: