Skip to main content
JPabl.1
Associate III
September 26, 2024
Solved

Best way to update a color in screen based on heart rate variable

  • September 26, 2024
  • 1 reply
  • 659 views

Hi there TouchGFX team!

 

I have a heart rate variable in my application. On the UI, I have a circle that can be green, yellow or red based on the value of the heart rate variable. 

 

What's the best way of implementing this? I can think in an "if" statement inside the tick handler that checks for the heart rate value but I would like to avoid a polling scenario. 

 

Thanks a lot in advance

Best answer by Peter BENSCH

There are many ways to realise something like this. One would be to create an image object for each coloured circle, the transparency of which can be switched between 0% and 100% as required. This saves computing time and enables lightning-fast switching between the different sprites.

Hope that helps?

Regards
/Peter

1 reply

Peter BENSCH
Peter BENSCHBest answer
Technical Moderator
September 26, 2024

There are many ways to realise something like this. One would be to create an image object for each coloured circle, the transparency of which can be switched between 0% and 100% as required. This saves computing time and enables lightning-fast switching between the different sprites.

Hope that helps?

Regards
/Peter