Drawing image while streaming data

Posted on
  • Hi folks! I'm trying to draw an Image on my Bangle Js 2 screen when a threshold on my HR is overcome: please find attached my code. Basically, the screen is lightining up but it seems like no time is left to draw the image on screen. Is it due to asynchronous execution of code? Any suggestion?


    1 Attachment

  • Hi! I just looked at the code and you do:

     g.drawImage(....
        }
      g.clear();
    

    So it's drawing the image, but then g.clear() clears the screen right after!

  • Thank you a lot! What if I'd like to make the image appear only for some time and then clear the screen? is there any built in method to use?

  • Open the Espruino Hardware Reference and do ctrl+f for "timeout" 🙂👌

  • Thanks, solved! I'm new to js and trying to make thing with sense! Just a last question: is there the possibility to use "import" with the Bangle.js to refer to other namespaces o scripts?

  • There's info regarding modules in the readme on the BangleApps github repository, https://github.com/espruino/BangleApps#modules. Maybe in other places as well. More than that I don't know 🙂

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Drawing image while streaming data

Posted by Avatar for Riccardokhm @Riccardokhm

Actions