DreamForce 2013 Hands-On Demo

Dependencies:   C12832_lcd EthernetInterface HTTPClient LM75B MMA7660 SocketIO WebSocketClient-ThermostatDemo mbed-rtos mbed picojson

main.cpp

Committer:
ansond
Date:
2013-11-01
Revision:
3:6afb87443041
Parent:
0:6b56785dd2b6

File content as of revision 3:6afb87443041:

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