Dreamforce 2013 MiniHack Thermostat Challenge - remotes

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

Fork of df-2013-minihack-thermostat-complete by MBED_DEMOS

main.cpp

Committer:
ansond
Date:
2013-11-11
Revision:
6:33f71cf9a04f
Parent:
0:26c48388f725
Child:
3:58f1cc293901

File content as of revision 6:33f71cf9a04f:

#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();
}