略過產品資訊
1 / 1

HK STEM CLUB

Ethernet W5100 網絡擴展板 SD卡擴展

Ethernet W5100 網絡擴展板 SD卡擴展

定價 HK$118.00
定價 售價 HK$118.00
特價 售罄
查看完整資訊

Ethernet擴展板可以讓控制器連接網絡。它是一塊內置WizNet W5100 TCP/IP微處理器的擴展板。這塊板通過長針腳排母(wire-wrap header)連接板。 使用 IDE中的Ethernet庫程序便可以輕鬆地使用這款擴展板連接到網絡中。這款擴展板支持同時4個socket的連接。 且該款擴展板的R3版本還新增了由4個額外端口組成的1.0標準版輸出端口:2個位於ARFF邊上,2個位於RESET邊上。 RESET邊上的兩個端口,一個是IOREF, 用來使擴展板適應主板。另一個空的端口預留給將來擴展的可能。 此款的版本新增micro-SD卡的插槽,擁有網絡存儲功能。此外,它和 Duemilanove,Mega系列也完全兼容。 它還擁有一個獨立的PoE( power-over-Ethernet)模塊。 該模塊可以焊接到主板上,從而通過雙絞線來傳輸電力。這是符合IEEE802.3af標準的,並和現存的PoE模塊相兼容。

Code:

/*
* Web Server
*
* A simple web server that shows the value of the analog input pins.
*/

#include

byte mac = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip = { 192, 168, 0, 15 };

Server server(80);

void setup()
{
Ethernet.begin(mac, ip);
server.begin();
}

void loop()
{
Client client = server.available();
if (client) {
// an http request ends with a blank line
boolean current_line_is_blank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
// if we've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so we can send a reply
if (c == '\n' && current_line_is_blank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();

// output the value of each analog input pin
client.print("welcome to tinyos");
client.println("
");
client.print("//*************************************");
client.println("
");
client.print(www.tinyos.net.cn);
client.println("
");
client.print("//*************************************");
client.println("
");
for (int i = 0; i < 6; i++) {
client.print("analog input ");
client.print(i);
client.print(" is ");
client.print(analogRead(i));
client.println("
");
}
break;
}
if (c == '\n') {
// we're starting a new line
current_line_is_blank = true;
} else if (c != '\r') {
// we've gotten a character on the current line
current_line_is_blank = false;
}
}
}
client.stop();
}
}