Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C12832_lcd EthernetInterface-ansond-patched HTTPClient-thermostat-remotes LM75B MMA7660 SocketIO WebSocketClient-ThermostatDemo mbed-rtos mbed picojson
main.cpp
00001 #include "mbed.h" 00002 00003 #include "Thermostat.h" 00004 00005 Serial pc(USBTX, USBRX); 00006 Thermostat *thermostat = NULL; 00007 00008 // check for exit 00009 void checkForExit() { 00010 if (pc.readable()) { 00011 char c = pc.getc(); 00012 if (c == 0x03) { // CTRL-C ASCII 00013 pc.printf("ctrl-c: closing down thermostat...\r\n"); 00014 if (thermostat != NULL) delete thermostat; 00015 pc.printf("app exiting...\r\n"); 00016 exit(1); 00017 } 00018 } 00019 } 00020 00021 int main() { 00022 thermostat = new Thermostat(); 00023 if (thermostat != NULL) thermostat->runDemo(); 00024 }
Generated on Tue Jul 12 2022 20:39:47 by
