Dreamforce Heroku Sample mbed application for the FRDM-K64F. This application uses SocketIO to connect and communicate with Heroku.

Dependencies:   BufferedSerial C12832 EthernetInterface HTTPClient-SSL LM75B MMA7660 SocketIO-k64f WebSocketClient-ThermostatDemo mbed-rtos mbed picojson

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

Committer:
ansond
Date:
Tue Nov 05 21:31:01 2013 +0000
Revision:
0:26c48388f725
Child:
6:74c1e9c8c90e
initial checkin

Who changed what in which revision?

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