The code is a horrifyingly awful bit of C++ and the whole thing is horrendously inefficient (rpi heating the room up doing arithmetic). I wouldn't want to publish it in its current form, and the next thing will be an analogue circuit. I might blog about that, though.