cancel
Showing results for 
Search instead for 
Did you mean: 

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

JPabl.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

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.

View solution in original post

1 REPLY 1
Peter BENSCH
ST Employee

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.