Bangle.js 2 setInterval() / changeInterval() problem #3330
Replies: 3 comments
-
Posted at 2024-01-04 by @fanoush maybe setTimeout is better fit? setInterval is supposed to be used when the method passed to it is called repeatedly in regular intervals, does not make much sense with value of 0 or when changing it all the time. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2024-01-05 by @gfwilliams Glad you got it fixed! ideally, yes, if you could just put a note about what was wrong that'd be much better than deleting the thread, and hopefully it'll help someone else! I'm not sure if it's related to your issue, but what I do notice is you do So I'd move Also, most clocks generally use the form used in https://www.espruino.com/Bangle.js+Clock+Font to ensure the clock face is always drawn on the minute:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2024-01-05 by pouzzler That was the problem, so I won't even edit my post to indicate what it was :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2024-01-04 by pouzzler
Edit 2: solved the problem. I am unaware of the ethics of this forum. Should I indicate my error and let the post to potentially help someone in the future, or simply remove it?
Edit: Kept only a more minimal version of the code, that still bugs, and got rid of what worked.
Hello, as a first project, I have made my own watch face, and it is working great except for a tiny detail.
The program's logic should be as follows :
a rectangle holding the battery percentage at the top right
a big HH:MM in the middle of the screen
a smaller DD MMM YYYY
and on the bottom a L M [M] J V S D (that's monday, tuesday, etc in french) with the current day inside a square
Everything works exactly as desired except on the very first update after uploading : the battery percentage (line 30) and the square around the day of the week (line 31) are not drawn as desired. As soon as the next minute begins, everything is drawn perfectly and stays that way.
Here is the whole code :
Should anyone have a hint, I would be most thankful :)
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions