2013-8-23 15:43:48 [显示全部楼层]
5041浏览
查看: 5041|回复: 3

[已解决] 我想知道X-BOARD V3的外形尺寸

[复制链接]
我想知道X-BOARD V3的外形尺寸,然后有直接带程序的吗?

Eric  初级技神

发表于 2013-8-24 15:29:12

X-BOARD V3外形尺寸为:长100.681mm X 宽40.64mm
程序你可以到产品维库里下载,写的很详细:https://wiki.dfrobot.com.cn/index.php/(SKU:DFR0222)X-Board%E7%BB%A7%E7%94%B5%E5%99%A8
回复

使用道具 举报

Eric  初级技神

发表于 2013-8-24 15:30:32

本帖最后由 Ricky 于 2013-8-29 01:39 编辑
  1. /*
  2. DFRobot X-board V2 Sample Code
  3. A simple web server with DHPC capbabilty.
  4. 1)Get IP address from router automatically
  5. 2)Show the value of the analog input pins
  6. created 28 Sep 2012
  7. by Ricky
  8. */
  9. #include <SPI.h>
  10. #include <Ethernet.h>
  11. EthernetServer server(80);
  12. // Enter a MAC address and IP address for your controller below.
  13. // The IP address will be dependent on your local network:
  14. byte mac[] = {
  15.   0xDE, 0xCD, 0xAE, 0x0F, 0xFE, 0xED };
  16. // Initialize the Ethernet server library
  17. // with the IP address and port you want to use
  18. // (port 80 is default for HTTP):
  19. void setup() {
  20.   // Open serial communications and wait for port to open:
  21.   Serial.begin(9600);
  22.   while (!Serial) {
  23.     ; // wait for serial port to connect. Needed for Leonardo only
  24.   }
  25.   // start the Ethernet connection:
  26.   if (Ethernet.begin(mac) == 0) {
  27.     Serial.println("Failed to configure Ethernet using DHCP");
  28.     // no point in carrying on, so do nothing forevermore:
  29.     for(;;)
  30.       ;
  31.   }
  32.   // print your local IP address:
  33.   Serial.print("My IP address: ");
  34.   for (byte thisByte = 0; thisByte < 4; thisByte++) {
  35.     // print the value of each byte of the IP address:
  36.     Serial.print(Ethernet.localIP()[thisByte], DEC);
  37.     Serial.print(".");
  38.   }
  39.   Serial.println();
  40.   // start the Ethernet connection and the server:
  41.   server.begin();
  42.   Serial.print("server is at ");
  43.   Serial.println(Ethernet.localIP());
  44. }
  45. void loop() {
  46.   // listen for incoming clients
  47.   EthernetClient client = server.available();
  48.   if (client) {
  49.     Serial.println("new client");
  50.     // an http request ends with a blank line
  51.     boolean currentLineIsBlank = true;
  52.     while (client.connected()) {
  53.       if (client.available()) {
  54.         char c = client.read();
  55.         Serial.write(c);
  56.         // if you've gotten to the end of the line (received a newline
  57.         // character) and the line is blank, the http request has ended,
  58.         // so you can send a reply
  59.         if (c == '\n' && currentLineIsBlank) {
  60.           // send a standard http response header
  61.           client.println("HTTP/1.1 200 OK");
  62.           client.println("Content-Type: text/html");
  63.           client.println("Connnection: close");
  64.           client.println();
  65.           client.println("<!DOCTYPE HTML>");
  66.           client.println("<html>");
  67.           // add a meta refresh tag, so the browser pulls again every 5 seconds:
  68.           client.println("<meta http-equiv="refresh" content="5">");
  69.           client.println("<link rel="stylesheet" type="text/css" href="http://www.dfrobot.com/ihome/stylesheet/stylesheet.css" />");
  70.           client.println("<center> <a href="http://www.dfrobot.com"><img src="http://alturl.com/qf6vz"></a> </center> ");
  71.           client.println("
  72. ");     
  73.           client.println("<div>");
  74.           // output the value of each analog input pin
  75.           for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
  76.             int sensorReading = analogRead(analogChannel);
  77.             client.print("analog input ");
  78.             client.print(analogChannel);
  79.             client.print(" is ");
  80.             client.print(sensorReading);
  81.             client.println("
  82. ");      
  83.           }
  84.           // output the value of each digital input pin
  85.           for (int digitalChannel = 2; digitalChannel < 10; digitalChannel++) {
  86.             int sensorReading = digitalRead(digitalChannel);
  87.             if(digitalChannel!=7&&digitalChannel!=8)
  88.             {
  89.               client.print("Digital input ");
  90.               client.print(digitalChannel);
  91.               client.print(" is ");
  92.               client.print(sensorReading);
  93.               client.println("
  94. ");
  95.             }
  96.             else
  97.             {
  98.               client.print("Relay ");
  99.               client.print(digitalChannel);
  100.               client.print(" is ");
  101.               client.print(sensorReading);
  102.               client.println("
  103. ");
  104.             }
  105.           }
  106.           client.println("</div>");
  107.           client.println("</html>");
  108.           break;
  109.         }
  110.         if (c == '\n') {
  111.           // you're starting a new line
  112.           currentLineIsBlank = true;
  113.         }
  114.         else if (c != '\r') {
  115.           // you've gotten a character on the current line
  116.           currentLineIsBlank = false;
  117.         }
  118.       }
  119.     }
  120.     // give the web browser time to receive the data
  121.     delay(1);
  122.     // close the connection:
  123.     client.stop();
  124.     Serial.println("client disonnected");
  125.   }
  126. }
复制代码
回复

使用道具 举报

Eric  初级技神

发表于 2013-8-24 15:31:21

回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies |上传

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail