Dreamforce 2013 MiniHack Thermostat Challenge - remotes
Dependencies: C12832_lcd EthernetInterface-ansond-patched HTTPClient-thermostat-remotes LM75B MMA7660 SocketIO WebSocketClient-ThermostatDemo mbed-rtos mbed picojson
Fork of df-2013-minihack-thermostat-complete by
Diff: Thermostat.cpp
- Revision:
- 5:9866322ed225
- Parent:
- 4:379e9ad21486
- Child:
- 6:33f71cf9a04f
diff -r 379e9ad21486 -r 9866322ed225 Thermostat.cpp --- a/Thermostat.cpp Sun Nov 10 16:38:24 2013 +0000 +++ b/Thermostat.cpp Mon Nov 11 20:29:32 2013 +0000 @@ -45,7 +45,7 @@ // DreamForce 2013 Tunables START // set our location -int location_index = 0; +int location_index = 2; // Remoted Thermostats // Thermostat 1: Austin TX 30.2500 –97.7500 @@ -272,7 +272,8 @@ } else { this->display("Send Failed: sent=%d",sent); - this->display_lcd("Send status: FAILED.\r\nSleeping..."); + this->display_lcd("Send status: FAILED.\r\nResetting..."); + NVIC_SystemReset(); } // blink the TX led @@ -373,27 +374,10 @@ // announce our position this->updateCoordinates(); - // if not connected... reconnect + // if not connected... reset if (!socketio.is_connected()){ - // announce - this->display("Re-connecting..."); - this->display_lcd("Re-connecting..."); - - // re-connect - if (this->connectWebSocketService()) { - // announce - this->display("Reconnect success"); - this->display_lcd("Reconnect: SUCCESS"); - this->turnRGBLEDGreen(); - this->resetAllLEDs(); - } - else { - // announce - this->display("Reconnect failure"); - this->display_lcd("Reconnect: FAILED"); - this->gracefullyDisconnect(); - this->turnRGBLEDRed(); - } + // reset + NVIC_SystemReset(); } // check and react to the joystick button press