erjiang 发表于 2012-12-4 12:55
这种情况需要手动设置IP地址的。参考官方W5100程序中,手动设定MAC与IP地址部分就行,在arduino的network包 ...
#include <SPI.h>
#include <Ethernet.h>
// the media access control (ethernet hardware) address for the shield:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
//the IP address for the shield:
byte ip[] = { 10, 0, 0, 177 };
void setup()
{
Ethernet.begin(mac, ip);
}
void loop () {}
是这个函数吧 |