How to make delays ? #6338
Unanswered
espruino-discuss2
asked this question in
Bangle.js
Replies: 1 comment
-
Posted at 2023-10-26 by rigrigrig You can use setTimeout:
Posted at 2023-10-26 by @thyttan Best is maybe to use a rigrig beat me to it! Posted at 2023-10-26 by Jaeth Okay, yeah, setTimeout sounds good ! How can I make it so that the reading only happen once every X seconds, too ? Wouldn't setTimeout make it run in loop and do the reading of the loop X seconds back ? Posted at 2023-10-26 by @fanoush setInterval |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2023-10-26 by Jaeth
I'm trying to make a compass that tells the user it's heading through vibration patterns ( one for each cardinal direction ). Thing is, I need to make the reading THEN send the vibration pattern some time after, because the magnetometer goes crazy when trying to read while the vibrator is on.
So, how can I make it so that it does something like "read heading, wait 0.3s then send vibration" ?
Beta Was this translation helpful? Give feedback.
All reactions