bus
Dependencies: Servo WIZnetInterface mbed-src
Fork of My_Weatherforecast_WIZwiki-W7500 by
Revision 18:a02a73acd3c8, committed 2015-06-29
- Comitter:
- joon874
- Date:
- Mon Jun 29 07:41:31 2015 +0000
- Parent:
- 17:ca0b0402a4fe
- Child:
- 19:420c2480c2a6
- Commit message:
- Using TCP Client with WIZwiki-W7500, display weather conditions on led and temperatures with servo-motor
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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();
