Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE EthernetInterface NTPClient mbed-rpc mbed-rtos mbed HTTPClient spxml
Diff: main.cpp
- Revision:
- 6:24d42cae48ad
- Parent:
- 5:be2cfaa8f4a2
- Child:
- 7:b0f2169bdf48
--- 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();