Code written by Paul Rabbat, Angel Daruna, Jarel Hawkins, and Cordel Williams
Dependencies: 4DGL-uLCD-SE EthernetInterface HTTPClient NTPClient PinDetect SDFileSystem mbed-rpc mbed-rtos mbed wave_player
Fork of ECE4180_FinalProject by
Revision 6:24d42cae48ad, committed 2014-12-01
- Comitter:
- prabbat3
- Date:
- Mon Dec 01 21:16:17 2014 +0000
- Parent:
- 5:be2cfaa8f4a2
- Child:
- 7:b0f2169bdf48
- Commit message:
- Updated location to ATL, temp to F
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Dec 01 18:35:32 2014 +0000 +++ b/main.cpp Mon Dec 01 21:16:17 2014 +0000 @@ -110,7 +110,7 @@ // main program only sets dimmer level (dim) // interrupt routines dim the light - Thread t1(thread_server); //start thread_server + //Thread t1(thread_server); //start thread_server Thread t2(thread_display); Thread t3(thread_alarm); @@ -124,7 +124,7 @@ /*** WEATHER****/ printf("Getting weather..\n"); HTTPClient http; - int retHttp = http.get("http://weather.yahooapis.com/forecastrss?w=28426187&u=c", buf, sizeof(buf)); + int retHttp = http.get("http://weather.yahooapis.com/forecastrss?w=2357024&u=f", buf, sizeof(buf)); switch(retHttp){ case HTTP_OK: @@ -146,11 +146,8 @@ SP_XmlDomParser parser; printf("\n----------%s----------\n",buf); - wait(5.0); - printf("Appending to parser..\n"); parser.append( buf, strlen(buf)); // stream current buffer data to the XML parser - wait(5.0); printf("Parser appended\n"); SP_XmlHandle rootHandle( parser.getDocument()->getRootElement() ); @@ -175,14 +172,14 @@ if (forecast) { printf("\r\n ----- Date:%s(%s) ----- \r\n",forecast->getAttrValue("date"),forecast->getAttrValue("day")); printf("Condition:%s \n",forecast->getAttrValue("text")); - printf("Temp:Low%sC High%sC\n",forecast->getAttrValue("low"),forecast->getAttrValue("high")); + printf("Temp:Low%sF High%sF\n",forecast->getAttrValue("low"),forecast->getAttrValue("high")); } forecast = rootHandle.getChild( "channel" ).getChild("item").getChild( "yweather:forecast",1).toElement(); if (forecast) { printf("\r\n ----- Date:%s(%s) ----- \r\n",forecast->getAttrValue("date"),forecast->getAttrValue("day")); printf("Condition:%s \n",forecast->getAttrValue("text")); - printf("Temp:Low%sC High%sC\n",forecast->getAttrValue("low"),forecast->getAttrValue("high")); + printf("Temp:Low%sF High%sF\n",forecast->getAttrValue("low"),forecast->getAttrValue("high")); } printf("Parser complete!\n"); @@ -290,8 +287,8 @@ if(!srv.init(SERVER_PORT)) { eth.disconnect(); - //return -1; printf("Thread 1 error.\n"); + return; } srv.run();