adfa
Dependencies: 4DGL-uLCD-SE NetServices mbed spxml
Fork of weather by
Diff: main.cpp
- Revision:
- 6:714ce05307c2
- Parent:
- 5:6c3b0bd1f680
- Child:
- 7:92cbee5144d7
--- a/main.cpp Thu Apr 28 23:45:54 2016 +0000 +++ b/main.cpp Fri Apr 29 03:45:26 2016 +0000 @@ -28,7 +28,6 @@ //extracts current weather XML data fields for LCD SP_XmlHandle handle(node); SP_XmlElementNode * condition = handle.getChild( "item" ).getChild("yweather:condition").toElement(); - lcd.cls(); // Print the name of the city lcd.locate(0,1); lcd.printf("%s:", loc); @@ -52,6 +51,7 @@ */ int weather() { + completed = false; SP_XmlDomParser parser; HTTPStream stream; @@ -67,7 +67,6 @@ stream.readNext((byte*)BigBuf, 512); //Buffer has been read, now we can put more data in it } } - //lcd.cls(); lcd.locate(0,6); if (result == HTTP_OK) { lcd.printf("Weather complete"); @@ -94,8 +93,9 @@ int traffic() { + completed = false; //char traff_domain_name[512] = "http://www.mapquestapi.com/traffic/v1/incidents?key=Vz3y4TYfSQa8b1iUJUv9N6meA9GAAhBH&callback=handleIncidentsResponse&boundingBox=33.977698,-84.662833,33.520957,-84.113516&filters=construction,incidents&inFormat=kvp&outFormat=xml"; - char traff_domain_name[512] = "https://www.mapquestapi.com/directions/v2/route?key=ZoiBJSzSoqfdNiLD0Z9kZdw4uAN5QUQW&from=Lancaster,PA&to=York,PA&outFormat=xml"; + char traff_domain_name[512] = "https://www.mapquestapi.com/directions/v2/route?key=ZoiBJSzSoqfdNiLD0Z9kZdw4uAN5QUQW&from=710%20Culworth%20Manor%2CAlpharetta%2CGA&to=855%20West%20Peachtree%20St%2CAtlanta%2CCGA&outFormat=xml"; char *tstartXML = "<realTime>"; //RSS XML start title char *tendXML = "</realTime>"; //RSS XML end title char *tsptr; //Start Pointer @@ -121,7 +121,6 @@ i=0; // loop to display lines on LCD for (j=0; (j)<(strlen(tsptr)-strlen(teptr)); j=j+16) { - // lcd.cls(); // clear screen before writing a new line //lcd.locate(0,(2+(j/16))); // loop to output a line on the LCD for (i=0; ((i<16)&&(tsptr[i+j] != '<')); i++) { @@ -131,7 +130,6 @@ } } wait(5); - //lcd.cls(); //clear LCD between traffic updates lcd.locate(0,5); } } while (tsptr!=NULL); // No more "<fullDesc>"s in BigBuf to display