Close

The UI and Python

A project log for RPI based thermostat

RPI, 18B20+ 1-wire, wifi, touchscreen

robRob 09/22/2015 at 02:020 Comments

I decided to use Python to code up this project. I'd never used it before, but it seemed pretty straightforward, and there were dozens of examples that I could cut and paste and mould to my needs. I started with the UI and discovered pygame as an easy way to work with graphics and sprites. My first version used sprites to animate the display with counter-rotating circles as the temperature was adjusted. This worked ok, but was a lot of code to get it all to work, and being new at python, my code grew unwieldy. Here's the first UI. Tap on the right to raise temp and left to lower.

It also has a timeout where it reverts to a second screen 30 seconds after adjusting or viewing the temp.

I also started to get worried about response to touch delays, but figured as I got more familiar with the code, I would find some optimizations.

Discussions