WIZ820ioNetIf
| WIZ820io | mbed |
| J2P1 GND | p1 GND |
| J1P3 MOSI | p11 SPI(mosi) |
| J2P6 MISO | p12 SPI(miso) |
| J1P4 SCK | p13 SPI(sck) |
| J1P5 nSS | p14 |
| J2P5 nRESET | p15 |
| J2P3 3V3D | p40 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.
