Dreamforce 2013 MiniHack Thermostat Challenge

Dependencies:   C12832_lcd EthernetInterface-ansond-patched HTTPClient-thermostat-remotes LM75B MMA7660 SocketIO WebSocketClient-ThermostatDemo mbed-rtos mbed picojson

Revision:
0:bca7aceedd02
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Nov 05 21:29:58 2013 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+
+#include "Thermostat.h"
+
+Serial pc(USBTX, USBRX);
+Thermostat *thermostat = NULL;
+
+// check for exit
+void checkForExit() {
+    if (pc.readable()) {
+        char c = pc.getc();
+        if (c == 0x03) {    // CTRL-C ASCII
+            pc.printf("ctrl-c: closing down thermostat...\r\n");
+            if (thermostat != NULL) delete thermostat;
+            pc.printf("app exiting...\r\n");
+            exit(1);
+        }
+    }
+}
+
+int main() {
+    thermostat = new Thermostat();
+    if (thermostat != NULL) thermostat->runDemo();
+}