DreamForce 2013 Hands-On Demo

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

Fork of ThermostatHandsOn by Doug Anson

Committer:
ansond
Date:
Mon Nov 11 20:35:13 2013 +0000
Revision:
7:57681d46485d
Parent:
0:6b56785dd2b6
updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ansond 0:6b56785dd2b6 1 #include "mbed.h"
ansond 0:6b56785dd2b6 2
ansond 0:6b56785dd2b6 3 #include "Thermostat.h"
ansond 0:6b56785dd2b6 4
ansond 0:6b56785dd2b6 5 Serial pc(USBTX, USBRX);
ansond 0:6b56785dd2b6 6 Thermostat *thermostat = NULL;
ansond 0:6b56785dd2b6 7
ansond 0:6b56785dd2b6 8 // check for exit
ansond 0:6b56785dd2b6 9 void checkForExit() {
ansond 0:6b56785dd2b6 10 if (pc.readable()) {
ansond 0:6b56785dd2b6 11 char c = pc.getc();
ansond 0:6b56785dd2b6 12 if (c == 0x03) { // CTRL-C ASCII
ansond 0:6b56785dd2b6 13 pc.printf("ctrl-c: closing down thermostat...\r\n");
ansond 0:6b56785dd2b6 14 if (thermostat != NULL) delete thermostat;
ansond 0:6b56785dd2b6 15 pc.printf("app exiting...\r\n");
ansond 0:6b56785dd2b6 16 exit(1);
ansond 0:6b56785dd2b6 17 }
ansond 0:6b56785dd2b6 18 }
ansond 0:6b56785dd2b6 19 }
ansond 0:6b56785dd2b6 20
ansond 0:6b56785dd2b6 21 int main() {
ansond 0:6b56785dd2b6 22 thermostat = new Thermostat();
ansond 0:6b56785dd2b6 23 if (thermostat != NULL) thermostat->runDemo();
ansond 0:6b56785dd2b6 24 }