sdfghjjh
Dependencies: Adafruit_GFX WIZnetInterface mbed
Fork of Weather_Forecast_Helloworld_WIZwiki-W7500 by
Diff: main.cpp
- Revision:
- 4:3384f1c0b2be
- Parent:
- 3:246564796e88
- Child:
- 6:780b86964a89
- Child:
- 7:b0f039c96a1c
--- a/main.cpp Mon Sep 07 04:10:41 2015 +0000 +++ b/main.cpp Thu Dec 10 06:27:42 2015 +0000 @@ -3,13 +3,7 @@ #include "EthernetInterface.h" #include "Adafruit_SSD1306.h" -/* - * Sheild LED - */ -// DigitalOut rled(D9); -// DigitalOut gled(D10); -// DigitalOut bled(D11); - + /* * W7500 onboard LED */ @@ -42,12 +36,12 @@ void clean(){ rled = 0; gled = 0; - bled = 1; + bled = 0; } void clouds(){ - rled = 0; - gled = 0; - bled = 0; + rled = 1; + gled = 1; + bled = 1; } void thunderstorm(){ while(1){ @@ -55,9 +49,9 @@ gled = 0; bled = 0; wait(0.5); - rled = 0; - gled = 0; - bled = 0; + rled = 1; + gled = 1; + bled = 1; wait(0.5); }; } @@ -108,7 +102,7 @@ int phy_link; printf("Wait a second...\r\n"); - uint8_t mac_addr[6] = {0x00, 0x08, 0xDC, 0x03, 0x04, 0x02}; + uint8_t mac_addr[6] = {0x00, 0x08, 0xDC, 0xff, 0xff, 0xa0}; EthernetInterface eth; @@ -139,16 +133,18 @@ /* * GET method, to request weather forecast - */ - char http_cmd[] = "GET /data/2.5/weather?q=Seoul,kr HTTP/1.0\n\n"; + */ + //char http_cmd[] = "GET /data/2.5/weather?q=London,uk&appid=2de143494c0b295cca9337e1e96b00e0 HTTP/1.0\n\n"; + char http_cmd[] = "GET /data/2.5/weather?q=Seoul,kr&appid=2de143494c0b295cca9337e1e96b00e0 HTTP/1.0\n\n"; //char http_cmd[] = "GET /data/2.5/weather?q=London,uk HTTP/1.0\n\n"; //char http_cmd[] = "GET /data/2.5/weather?q=Berlin,de HTTP/1.0\n\n"; + sock.send_all(http_cmd, sizeof(http_cmd)-1); /* * get data into buffer */ - char buffer[1024]; + char buffer[2048]; int ret; while (true) { ret = sock.receive(buffer, sizeof(buffer)-1); @@ -171,7 +167,7 @@ char weather_con[15] = {0}; char city_name[10] = {0}; char temper_data[3] = {0}; - + int temp; int num100, num10, num1;