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: BufferedSerial C12832 EthernetInterface HTTPClient-SSL LM75B MMA7660 SocketIO-k64f WebSocketClient-ThermostatDemo mbed-rtos mbed picojson
Fork of df-2013-minihack-thermostat-complete by
main.cpp
00001 #include "mbed.h" 00002 00003 #include "Thermostat.h" 00004 00005 #include "BufferedSerial.h" 00006 BufferedSerial pc(USBTX, USBRX); 00007 Thermostat *thermostat = NULL; 00008 00009 // check for exit 00010 void checkForExit() { 00011 if (pc.readable()) { 00012 char c = pc.getc(); 00013 if (c == 0x03) { // CTRL-C ASCII 00014 pc.printf("ctrl-c: closing down thermostat...\r\n"); 00015 if (thermostat != NULL) delete thermostat; 00016 pc.printf("app exiting...\r\n"); 00017 exit(1); 00018 } 00019 } 00020 } 00021 00022 int main() { 00023 thermostat = new Thermostat(); 00024 if (thermostat != NULL) thermostat->runDemo(); 00025 }
Generated on Wed Jul 13 2022 00:00:04 by
1.7.2
