I want to display a message while the GPS is powered on , setup and then powered off.
What is the wait function? If it's what I think it is, it's best to totally avoid those - if the function actually waits for 500ms, that stops Espruino from handling any data that comes in, which will probably cause buffer overflows.
However if wait uses setTimeout then you'll find that the code drops through immediately and displays your message and then maybe clears it right after. I'd say what you really need is something like:
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
That's great!
What is the
wait
function? If it's what I think it is, it's best to totally avoid those - if the function actually waits for 500ms, that stops Espruino from handling any data that comes in, which will probably cause buffer overflows.However if
wait
uses setTimeout then you'll find that the code drops through immediately and displays your message and then maybe clears it right after. I'd say what you really need is something like:Also, just FYI but you can also just do
E.showMessage("Configuring GPS")
- it's a helper function for this sort of thing.