Central Heating controller using the real time clock, PHY module for internet, 1-wire interface for temperature sensors, a system log and a configuration file
Dependencies: net 1-wire lpc1768 crypto clock web fram log
/media/uploads/andrewboyson/heating.sch
/media/uploads/andrewboyson/heating.brd
/media/uploads/andrewboyson/eagle.epf
Diff: http-derived/radiator/http-radiator-script.inc
- Revision:
- 47:229338b3adcb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/http-derived/radiator/http-radiator-script.inc Tue Apr 23 18:47:47 2019 +0000 @@ -0,0 +1,38 @@ +"//Radiator script\n" +"'use strict';\n" +"\n" +"let hallTemperature = '';\n" +"let programTimerOutput = false;\n" +"let radiatorMode = false;\n" +"let radiatorOverride = false;\n" +"let radiatorPump = false;\n" +"let nightSetPoint = '';\n" +"let frostSetPoint = '';\n" +"\n" +"function parse()\n" +"{\n" +" let lines = Ajax.response.split('\\n');\n" +" hallTemperature = OneWire.DS18B20ToString (lines[0]);\n" +" programTimerOutput = Ajax.hexToBit (lines[1], 0);\n" +" radiatorMode = Ajax.hexToBit (lines[1], 1);\n" +" radiatorOverride = Ajax.hexToBit (lines[1], 2);\n" +" radiatorPump = Ajax.hexToBit (lines[1], 3);\n" +" nightSetPoint = Ajax.hexToSignedInt16(lines[2], 16);\n" +" frostSetPoint = Ajax.hexToSignedInt16(lines[3], 16);\n" +"}\n" +"function display()\n" +"{\n" +" let elem;\n" +" elem = Ajax.getElementOrNull('ajax-hall-html' ); if (elem) elem.textContent = hallTemperature;\n" +" elem = Ajax.getElementOrNull('ajax-program-toggle' ); if (elem) elem.setAttribute('dir', programTimerOutput ? 'rtl' : 'ltr');\n" +" elem = Ajax.getElementOrNull('ajax-mode-toggle' ); if (elem) elem.setAttribute('dir', radiatorMode ? 'rtl' : 'ltr');\n" +" elem = Ajax.getElementOrNull('ajax-override-toggle'); if (elem) elem.setAttribute('dir', radiatorOverride ? 'rtl' : 'ltr');\n" +" elem = Ajax.getElementOrNull('ajax-radiator-toggle'); if (elem) elem.setAttribute('dir', radiatorPump ? 'rtl' : 'ltr');\n" +" elem = Ajax.getElementOrNull('ajax-night-set-point'); if (elem) elem.value = nightSetPoint;\n" +" elem = Ajax.getElementOrNull('ajax-frost-set-point'); if (elem) elem.value = frostSetPoint;\n" +"}\n" +"\n" +"Ajax.server = '/radiator-ajax';\n" +"Ajax.onResponse = function() { parse(); display(); };\n" +"Ajax.init();\n" +"" \ No newline at end of file