08-16-2021 12:31 - edited 08-16-2021 12:31
08-16-2021 12:31 - edited 08-16-2021 12:31
Right now I am facing the issue that my metronome application which vibrates depending on defined BPM is approx. only updated once per second if the screen is off on my Versa3/Sense. Due to the fact that setInterval itself is not accurate enough for a metronome I am using the new Date() object to check the passed milliseconds after each 10ms with setInterval function. Maybe there are better ways to implement this but it worked completly fine with my old Versa.
For some reasons the application is working fine as long as developer bridge is enabled on phone/Versa3. This is the reason why I didn't notice this issue in development phase. Also the review by Fitbit was passed without any issues. The bug was reported by users.
Can someone explain what happens here or how I can fix it?
Thanks for your support!
08-22-2021 20:35
08-22-2021 20:35
The setInterval may not be that accurate but possibly check less often than 10 ms.
Depending on the code it may take too long to process for such a short period and of course you are clearing the old interval at each adjustment?
Odd about the developer bridge having an influence.
Author | ch, passion for improvement.
09-16-2021 11:47
09-16-2021 11:47
Thanks for your reply @Guy_. The modification of the interval period does not change anything and the interval is cleared after each adjustment.
I have also added some logging (for "debugging" reasons) on the screen for each interval execution and I can see correct timestamps but the vibration is missing. But if the logging (text) on the screen is added during screen is off or immediatly after turning the screen on I am obviously not sure.
Maybe someone from Fitbit can explain the reason why this happens.