2024-09-24 01:22 AM - edited 2024-09-24 01:25 AM
According to Dynamic Graph | TouchGFX Documentation ,I used handleTickEvent() to refresh the dynamic graph that is representing a sensor data, despite of refreshing the graph in per tick (if (tickCounter % 1 == 0)) but it's still slow to show a precise graph. How can I accelerate adding data points more than a tick (<16ms) ?
Solved! Go to Solution.
2024-09-24 03:19 AM
Hello @Jj.21 ,
Your display most likely refresh at 60 frames per second, so you cannot refresh the graph widget more that the screen refresh itself. Even if you did, you would not see the difference. Also, a refresh rate above 60 fps is barely noticeable by the human eye.
Did you mean that you want to have more that 60 new data point every second?
For instance, maybe you want to have one data point every ms.
In that case, the simplest way to do it would be to do it outside of TouchGFX, either in the main directly or by using the RTOS.
For instance, if you get an interrupt every ms with a new data, you can store that in an array in the main that is accessible by TouchGFX and every tick you add the new data.
Another way would be to add the data to a queue from the RTOS and every tick to empty that queue of new data to add them to your graph.
I hope this helps! :smiling_face_with_smiling_eyes:
If this comment helps you, I invite you to select it as "best answer".
Regards,
2024-09-24 03:19 AM
Hello @Jj.21 ,
Your display most likely refresh at 60 frames per second, so you cannot refresh the graph widget more that the screen refresh itself. Even if you did, you would not see the difference. Also, a refresh rate above 60 fps is barely noticeable by the human eye.
Did you mean that you want to have more that 60 new data point every second?
For instance, maybe you want to have one data point every ms.
In that case, the simplest way to do it would be to do it outside of TouchGFX, either in the main directly or by using the RTOS.
For instance, if you get an interrupt every ms with a new data, you can store that in an array in the main that is accessible by TouchGFX and every tick you add the new data.
Another way would be to add the data to a queue from the RTOS and every tick to empty that queue of new data to add them to your graph.
I hope this helps! :smiling_face_with_smiling_eyes:
If this comment helps you, I invite you to select it as "best answer".
Regards,
2024-09-25 03:39 AM
I really appreciate you. I tried your first solution, and it worked.
2024-09-25 05:51 AM
I am glad it helped you! :smiling_face_with_smiling_eyes: