找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3116|回复: 1
收起左侧

W5100的Arduino源码与IP地址查找方法

[复制链接]
ID:412731 发表于 2018-10-20 14:58 | 显示全部楼层 |阅读模式
W5100 IP地址查找
  • 点击电脑左下键盘的 开始
  • 然后在点击运行
  • 然后会跳出一个框框 再里面输入 cmd
  • 然后点击确定就会出现另外一个黑色的框框
  • 再在里面输入ipconfig
  • 然后点击回车键 就可以看到自己的IP了

Arduino W5100 Test
1.Stack your W5100 shield on you arduino board,make sure all the pins contact OK.
SIZE:   L-69MM    W-53.6MM
2.Download the test sketch
arduino w5100 test code:
  1. /************************************************/

  2. #include <SPI.h>

  3. /*
  4. * Web Server
  5. *
  6. * A simple web server that shows the value of the analog input pins.
  7. */
  8. #include <Ethernet.h>
  9. byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
  10. byte ip[] =  { 192, 168, 0, 15 };
  11. Server server(80);
  12. void setup()
  13. {
  14.   Ethernet.begin(mac, ip);
  15.   server.begin();
  16. }
  17. void loop()
  18. {
  19.   Client client = server.available();
  20.   if (client) {
  21.     // an http request ends with a blank line
  22.     boolean current_line_is_blank = true;
  23.     while (client.connected()) {
  24.       if (client.available()) {
  25.         char c = client.read();
  26.         // if we've gotten to the end of the line (received a newline
  27.         // character) and the line is blank, the http request has ended,
  28.         // so we can send a reply
  29.         if (c == 'n' && current_line_is_blank) {
  30.           // send a standard http response header
  31.           client.println("HTTP/1.1 200 OK");
  32.           client.println("Content-Type: text/html");
  33.           client.println();
  34.          
  35.           // output the value of each analog input pin
  36.           client.print("welcome to tinyos electronics");
  37.           client.println("<br />");
  38.           client.print("//*************************************");
  39.           client.println("<br />");
  40.           client.print("");
  41.           client.println("<br />");
  42.           client.print("//*************************************");
  43.           client.println("<br />");
  44.           for (int i = 0; i < 6; i++) {
  45.             client.print("analog input ");
  46.             client.print(i);
  47.             client.print(" is ");
  48.             client.print(analogRead(i));
  49.             client.println("<br />");
  50.           }
  51.           break;
  52.         }
  53.         if (c == 'n') {
  54.           // we're starting a new line
  55.           current_line_is_blank = true;
  56.         } else if (c != 'r') {
  57.           // we've gotten a character on the current line
  58.           current_line_is_blank = false;
  59.         }
  60.       }
  61.     }
  62.     client.stop();
  63.   }
  64. }

  65. /************************************************/
复制代码

3.Connet your W5100 board and PC with cable(you may need a crossover cable if you direct connect PC and W5100)
4. Setting your local PC IP
5.You will see PC Local connection show connected and W5100 4 LEDS will turn ON
FULLD,100M,LINK,PWR
If not please try to press RESET button on W5100 Shield.
5.Now you can PING the W5100
6.Visit 192.168.0.15 you can see the test web page


全部资料51hei下载地址:
W5100 网络扩展板 资料.rar (355.87 KB, 下载次数: 11)
回复

使用道具 举报

ID:162514 发表于 2018-10-29 13:36 | 显示全部楼层
过时了,现在是wifi!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表