產品說明0
產品簡介
這款新版DFRduino Ethernet W5100擴展板能使你的Arduino控制器連接到因特網。它是一塊內置WizNet W5100 TCP/IP微處理器的擴展板。這塊板通過長針腳排母(wire-wrap header)連接arduino板。使用Arduino IDE中的Ethernet庫程序便可以輕鬆地使用這款擴展板連接到網絡中。這款擴展板支持同時4個socket的連接。
此款最新的版本新增micro-SD卡的插槽,用來大容量的網絡存儲。此外,它和Arduino Duemilanove/Uno,Mega系列也完全兼容。SD卡的庫不在標準庫裡包括,但是Bill Greiman寫的sdfatlib能夠很好的工作。可以參見Adafruit寫的教程。最新的修改包括重設控制器,用來保證the W5100 Ethernet模塊能在打開電源的時候重設。之前的修改不支持Mega並需要手動重設。最早的修改是不支持sd卡槽。
Arduino能夠通過SPI口和W5100和SD卡進行通信(用ICSP頭)。這個是在Duemilanove/Uno上的數字11,12,13口和Mega的50,51,52號口。這些端口不能用作一般的輸入輸出。在Mega上,硬件SS口,53,不能用於W5100和SD卡,但是它必須要被用於輸出口,否則SPI接口沒法工作。
這塊Ethernet板提供標準的RJ45以太網插座。擴展板上的Reset按鍵可以同時重啟W5100芯片以及Arduino控制器。
注意事項:因為W5100和SD卡公用SPI口,而只有一個能在同一時間激活。如果你同時想用兩個,這必須在相應的庫裡處理。如果你不用其中任一外設,你需要特別說明不選擇使用它們。想不用SD卡,把4號口設為輸出並且寫為高電平。想不用W5100,把10號設為高電平輸出。
技術規格
- 擴展板工作電壓:5v
- 以太網插座
- 支持Micro SD卡讀/寫
- Ethernet和SD卡共用SPI接口,只能單獨啟用一個功能
- 兼容Arduino標準尺寸控制器,同時支持Arduino Mega系列
- 尺寸:70x55x30mm
配送清單
- 新版DFRduino Ethernet W5100擴展板 兼容Arduino 1塊
相關文檔
相關例程
/*
* Web Server
*
* A simple web server that shows the value of the analog input pins.
*/
#include <Ethernet.h>
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 DFRobot");
client.println("<br />");
client.print("//*************************************");
client.println("<br />");
client.print("");
client.println("<br />");
client.print("//*************************************");
client.println("<br />");
for (int i = 0; i < 6; i++) {
client.print("analog input ");
client.print(i);
client.print(" is ");
client.print(analogRead(i));
client.println("<br />");
}
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();
}
}
實驗結果,通過IE瀏覽器顯示6個模擬口的讀數,刷新網頁就更新一次數據。
範例圖↓↓↓