WIZ820ioNetIf

/media/uploads/va009039/wiz820ionetif.jpg

WIZ820iombed
J2P1 GNDp1 GND
J1P3 MOSIp11 SPI(mosi)
J2P6 MISOp12 SPI(miso)
J1P4 SCKp13 SPI(sck)
J1P5 nSSp14
J2P5 nRESETp15
J2P3 3V3Dp40 VOUT

※PWDNの結線を外しました。

Import libraryw5200NetIf

W5200(WIZ820io) network interface

Warning

EthernetNetIfもインポートします。 Please import EthernetNetIf library.

main.cpp

#include "WIZ820ioNetIf.h"
#include "HTTPClient.h"
#include "HTTPServer.h"

WIZ820ioNetIf eth;
HTTPServer svr;
HTTPClient http;
HTTPStream stream;

void callback(HTTPResult r){printf("callback(%d)\n",r);}

int main() {
    eth.setup();
    svr.addHandler<SimpleHandler>("/");
    svr.bind(80);
    http.get("http://mbed.org/feeds/activity/", &stream, callback);
    byte buf[256];
    stream.readNext(buf, sizeof(buf));
    while(1) {
        if(stream.readable()) {
            printf("%d\n", stream.readLen());
            stream.readNext(buf, sizeof(buf));
        }
        Net::poll();
    }
}


Please log in to post comments.