I've only had time for a quick glance, but it looks good to me.
Only things I'd say are:
As a style thing, in the Espruino code I tend to have variables starting with a lowercase letter, and classes starting with uppercase.. So tempHistory instead of TempHistory - but that's purely personal style :)
You might want to put your initialisation code in an onInit function - when you get around to saving your code into flash, that function will then get called at power-on.
Where you do setInterval( function() { ... }, 60000); it might be easier to do function onMinute() { ... }; setInterval(onMinute, 60000);. It means that you can then use the left-hand side of the Web IDE to modify the onMinute function while your code is running - it's handy for debugging, especially in a system like this where it'll take a few minutes for the PID system to get happy (so you're unlikely to want to reset too often!).
With the whole PID thing, I'd really like to come up with a PID library for Espruino that had some kind of self-calibrating functionality. Getting the correct values seems like magic to me!
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I've only had time for a quick glance, but it looks good to me.
Only things I'd say are:
tempHistory
instead ofTempHistory
- but that's purely personal style :)onInit
function - when you get around to saving your code into flash, that function will then get called at power-on.setInterval( function() { ... }, 60000);
it might be easier to dofunction onMinute() { ... }; setInterval(onMinute, 60000);
. It means that you can then use the left-hand side of the Web IDE to modify theonMinute
function while your code is running - it's handy for debugging, especially in a system like this where it'll take a few minutes for the PID system to get happy (so you're unlikely to want to reset too often!).With the whole PID thing, I'd really like to come up with a PID library for Espruino that had some kind of self-calibrating functionality. Getting the correct values seems like magic to me!