wave cancel
Dependencies: 4DGL-uLCD-SE EthernetInterface HTTPClient NTPClient PinDetect SDFileSystem mbed-rtos mbed wave_player
Fork of 4180_Final_Project by
Diff: main.cpp
- Revision:
- 10:6b27fafad047
- Parent:
- 9:fbb5f22fc299
- Child:
- 11:89e778e985d5
diff -r fbb5f22fc299 -r 6b27fafad047 main.cpp --- a/main.cpp Sun Apr 24 19:39:01 2016 +0000 +++ b/main.cpp Mon Apr 25 15:48:53 2016 +0000 @@ -27,14 +27,12 @@ // Parameters char* time_domain_name = "0.uk.pool.ntp.org"; //char* weth_domain_name = "http://weather.yahooapis.com/forecastrss?w=2502265"; -//char* weth_domain_name = "https://query.yahooapis.com/v1/public/yql?q=select%20item.condition%20from%20weather.forecast%20where%20woeid%20in%20%28select%20woeid%20from%20geo.places%281%29%20where%20text%3D%22atlanta%2C%20ga%22%29&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys"; +//char* weth_domain_name = "http://developer.mbed.org/media/uploads/mbed_official/hello.txt"; char* weth_domain_name = "https://query.yahooapis.com/v1/public/yql?q=select%20item.condition%20from%20weather.forecast%20where%20woeid%20in%20%28select%20woeid%20from%20geo.places%281%29%20where%20text%3D%22atlanta%2C%20ga%22%29&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys"; int port_number = 123; // Networking EthernetInterface eth; -NTPClient ntp_client; - #define snoozeTime 10 //global variables @@ -87,7 +85,7 @@ { //lcd_mutex.lock(); /*** WEATHER****/ - char buf[500]; + char buf[250]; uLCD.printf("Getting weather..\n"); HTTPClient http; int retHttp = http.get(weth_domain_name, buf, sizeof(buf)); @@ -193,9 +191,12 @@ getWeather(); wait(500); // Read time from server - uLCD.printf("Reading time...\n\r"); - ntp_client.setTime(time_domain_name, port_number); - uLCD.printf("Time set\n"); + { + uLCD.printf("Reading time...\n\r"); + NTPClient ntp_client; + ntp_client.setTime(time_domain_name, port_number); + uLCD.printf("Time set\n"); + } Thread::wait(2000); eth.disconnect();