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:
- 6:33f71cf9a04f
- Parent:
- 5:9866322ed225
--- a/Thermostat.cpp Mon Nov 11 20:29:32 2013 +0000 +++ b/Thermostat.cpp Mon Nov 11 22:46:25 2013 +0000 @@ -45,24 +45,27 @@ // DreamForce 2013 Tunables START // set our location -int location_index = 2; +int location_index = 0; // Remoted Thermostats -// Thermostat 1: Austin TX 30.2500 –97.7500 -// Thermostat 2: Phoenix AZ 33.4500 -112.0667 -// Thermostat 3: Dallas TX 32.7758 -96.7967 -// Thermostat 4: Miami FL 25.7877 -80.2241 -// Thermostat 5: Chicago IL 41.8819 –87.6278 -// Thermostat 6: Memphis TN 35.1174 -89.9711 -// Thermostat 7: Seattle WA 47.6097 –122.3331 -// Thermostat 8: New York NY 40.6700 –73.9400 -// Thermostat 9: Raleigh NC 35.8189 –78.6447 -// Thermostat 10: Moscone 37.7842 –122.4016 +// Thermostat 0: Austin TX 30.2500 –97.7500 +// Thermostat 1: Phoenix AZ 33.4500 -112.0667 +// Thermostat 2: Dallas TX 32.7758 -96.7967 +// Thermostat 3: Miami FL 25.7877 -80.2241 +// Thermostat 4: Chicago IL 41.8819 –87.6278 +// Thermostat 5: Memphis TN 35.1174 -89.9711 +// Thermostat 6: Seattle WA 47.6097 –122.3331 +// Thermostat 7: New York NY 40.6700 –73.9400 +// Thermostat 8: Raleigh NC 35.8189 –78.6447 +// Thermostat 9: Moscone 37.7842 –122.4016 float latitudes[10] = { 30.2500, 33.4500, 32.7758, 25.7877, 41.8819, 35.1174, 47.6097, 40.6700, 35.8189, 37.7842}; float longitudes[10] = { -97.7500, -112.0667, -96.7967, -80.2241, -87.6278, -89.9711, -122.3331, -73.9400, -78.6447, -122.4016}; char *locations[10] = { "DF Thermostat-Austin TX", "DF Thermostat-Phoenix AZ", "DF Thermostat-Dallas TX", "DF Thermostat-Miami FL", "DF Thermostat-Chicago IL", "DF Thermostat-Memphis TN", "DF Thermostat-Seattle WA", "DF Thermostat-New York NY", "DF Thermostat-Raleigh NC", "DF Thermostat-Moscone Center"}; +char *lcd_locations[10]= { "Austin TX", "Phoenix AZ", "Dallas TX", "Miami FL", + "Chicago IL", "Memphis TN", "Seattle WA", + "New York NY", "Raleigh NC", "Moscone Center"}; // DreamForce 2013 Tunables END @@ -267,8 +270,8 @@ // Log if (sent > 0) { - this->display("Send success. Ready..."); - this->display_lcd("Send status: OK.\r\nSleeping..."); + this->display("Send success. Ready...Location: %s",lcd_locations[location_index]); + this->display_lcd("Send status: OK.\r\nSleeping...\r\nLocation: %s",lcd_locations[location_index]); } else { this->display("Send Failed: sent=%d",sent); @@ -447,8 +450,8 @@ // Run the Demo void Thermostat::runDemo() { // Announce - this->display("Thermostat Hands-On Demo v1.0"); - this->display_lcd("Thermostat Hands-On\r\nDemo v1.0"); + this->display("Thermostat Remote v1.0"); + this->display_lcd("Thermostat Remote\r\nDemo v1.0"); // init the RGB LED this->display("Initializing LEDs..."); @@ -469,5 +472,5 @@ } // exit the application if we get here - exit(1); + NVIC_SystemReset(); } \ No newline at end of file