Skip to main content
JPabl.1
Associate III
Sep 26, 2024 5:30 PM UTC
Solved

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

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

This topic has been closed for replies.
Peter BENSCH
Peter BENSCHBest answer
ST Technical Moderator
Sep 26, 2024 6:13 PM UTC

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

1 reply

Peter BENSCH
Peter BENSCHBest answer
ST Technical Moderator
Sep 26, 2024 6:13 PM UTC

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.