Using PyGame to visualize MQTT data stream

Using the baseline MQTT sample codes from my last blog, I incorporated a visual element using PyGame so we can represent the oven temperatures as colored sprite on the screen.

If you have not read that blog yet, here’s the link:

Demo video

I uploaded the recording of my test as it’s best shown as a video than set of images.

Here’s the video where I used PyGame to display the oven temperature values as colored box

NOTE that the color is just an RGB that is based on the temperature values — the higher the value, the more “reddish” the box becomes (to show it’s getting hotter).

This however, requires a considerable “jump” in programming as it now uses threading, and you need to be comfortable or at least familiar with asynchronous and/or concurrent programming.

I can’t explain all the important details without making this blog very long and make you fall asleep, so maybe I’ll do it on another blog or explain in a video.

Thanks for dropping by!

Leave a Comment