Other code will run too
The code you have in events blocks will continue to execute while the current part of your program is paused.
Pause the current part of the program until a condition becomes true.
pauseUntil(() => true)
Sometimes you need to wait in one part of a program for something to happen somewhere else in the program. This is done by pausing until some condition elsewhere becomes true. Such a condition could be a value you set in an event block or a function that returns a boolean.
true.true. The pause ends when the timeout has elapsed even if condition is still false.The code you have in events blocks will continue to execute while the current part of your program is paused.
Wait on a five second timer function.
function waitFiveSeconds() : boolean {
for (let i = 0; i < 5000; i++) {
control.waitMicros(1000)
}
return true
}
pauseUntil(() => waitFiveSeconds())