题目已经说得很明确了,我也看了坛子里的有做出坛友的例程,可是我搞了一个星期加一个星期天。我觉得根本就有问题,网络接口下的两个灯始终没亮过,我的试验程序也简单就是看MAC能否测到测到就打印一行成功,不成功就不成功,但我下进运行后,始终死机。我试了N遍了。对坛子里做出的程序我也试了,根本不是那么回事。我对网络接口可用性提出了强烈的疑问,同时也请瑞萨的工程师给下解释,为什么我的连灯都不闪一下。
/*GR-SAKURA Sketch Template Version: V1.01*/
#include <rxduino.h>
#include <Ethernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network.
// gateway and subnet are optional:
byte mac[] = {
0x00,0x23,0xCD,0x72,0x64,0x7E };
byte ip[] ={192,168,1,100};
byte gateway[] ={192,168,1,1};
byte subnet[] ={255,255,255,0};
TEthernet net;
boolean alreadyConnected = false; // whether or not the client was connected previously
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
// initialize the ethernet device
if(net.begin(mac))
Serial.println("mac is right!");
delay(1000);
Serial.print("Chat server address:");
delay(1000);
Serial.println(net.localIP());
delay(1000);
}
void loop() {
Serial.print("Chat server address:");
delay(1000);
Serial.println(net.localIP());
delay(1000);
}