bus
Dependencies: Servo WIZnetInterface mbed-src
Fork of My_Weatherforecast_WIZwiki-W7500 by
Diff: main.cpp
- Revision:
- 18:a02a73acd3c8
- Parent:
- 17:ca0b0402a4fe
- Child:
- 19:420c2480c2a6
--- a/main.cpp Fri Jun 26 00:05:31 2015 +0000 +++ b/main.cpp Mon Jun 29 07:41:31 2015 +0000 @@ -42,7 +42,7 @@ sock.send_all(http_cmd, sizeof(http_cmd)-1); /* get info */ - char buffer[500]; + char buffer[420]; int ret; while (true) { ret = sock.receive(buffer, sizeof(buffer)-1); @@ -65,6 +65,7 @@ printf("%.4s\n", weather + 7); for(int i=0; i<3;i++){ weather_stu[i] = weather[i+7]; + printf("%c",weather_stu[i]); } city = strstr(buffer, "name"); @@ -103,11 +104,23 @@ rled = 1; gled = 1; bled = 0; + }else if(strcmp(weather_stu,"Mis")==0){ + rled = 1; + gled = 0; + bled = 1; + }else if(strcmp(weather_stu,"Haz")==0) { + rled = 1; + gled = 1; + bled = 1; + }else if(strcmp(weather_stu,"Fog")==0){ + rled = 1; + gled = 0; + bled = 1; }else { rled = 0; + gled = 0; bled = 0; - gled = 0; - } + } sock.close();