“Ethernet库”的版本间的差异

来自YFRobotwiki
跳转至: 导航搜索
 
第47行: 第47行:
 
'''The Ethernet class initializes the ethernet library and network settings. '''
 
'''The Ethernet class initializes the ethernet library and network settings. '''
  
:-[[Ethernet:begin()| begin()]]
+
:-[[Ethernet.begin()| begin()]]
  
:-[[Ethernet:localIP()| localIP()]]
+
:-[[Ethernet.localIP()| localIP()]]
  
:-[[Ethernet:maintain()| maintain()]]
+
:-[[Ethernet.maintain()| maintain()]]
  
 
<br>
 
<br>
第58行: 第58行:
 
'''The IPAddress class works with local and remote IP addressing. '''
 
'''The IPAddress class works with local and remote IP addressing. '''
  
:-[[Ethernet:IPAddress()()| IPAddress()]]
+
:-[[Ethernet.IPAddress()()| IPAddress()]]
  
 
<br>
 
<br>
第65行: 第65行:
 
'''The Server class creates servers which can send data to and receive data from connected clients (programs running on other computers or devices). '''
 
'''The Server class creates servers which can send data to and receive data from connected clients (programs running on other computers or devices). '''
  
:-[[Server:Server()| Server()]]
+
:-[[Server.Server()| Server()]]
  
:-[[Server:EthernetServer()| EthernetServer()]]
+
:-[[Server.EthernetServer()| EthernetServer()]]
  
:-[[Server:begin()| begin()]]
+
:-[[Server.begin()| begin()]]
  
:-[[Server:available()| available()]]
+
:-[[Server.available()| available()]]
  
:-[[Server:write()| write()]]
+
:-[[Server.write()| write()]]
  
:-[[Server:print()| print]]
+
:-[[Server.print()| print]]
  
:-[[Server:println()| println()]]
+
:-[[Server.println()| println()]]
  
 
<br>
 
<br>
第84行: 第84行:
 
'''The client class creates clients that can connect to servers and send and receive data. '''
 
'''The client class creates clients that can connect to servers and send and receive data. '''
  
:-[[Client:Client()| Client()]]
+
:-[[Client.Client()| Client()]]
  
:-[[Client:EthernetClient()| EthernetClient()]]
+
:-[[Client.EthernetClient()| EthernetClient()]]
  
:-[[Client:if (EthernetClient)| if (EthernetClient)]]
+
:-[[Client.if (EthernetClient)| if (EthernetClient)]]
  
:-[[Client:connected()| connected()]]
+
:-[[Client.connected()| connected()]]
  
:-[[Client:connect()| connect()]]
+
:-[[Client.connect()| connect()]]
  
:-[[Client:write()| write]]
+
:-[[Client.write()| write]]
  
:-[[Client:print()| print]]
+
:-[[Client.print()| print]]
  
:-[[Client:println()| println()]]
+
:-[[Client.println()| println()]]
  
:-[[Client:available()| available()]]
+
:-[[Client.available()| available()]]
  
:-[[Client:read()| read()]]
+
:-[[Client.read()| read()]]
  
:-[[Client:flush()| flush()]]
+
:-[[Client.flush()| flush()]]
  
:-[[Client:stop()| stop()]]
+
:-[[Client.stop()| stop()]]
  
 
<br>
 
<br>
第113行: 第113行:
 
'''The EthernetUDP class enables UDP message to be sent and received. '''
 
'''The EthernetUDP class enables UDP message to be sent and received. '''
  
:-[[EthernetUDP:begin()| begin()]]
+
:-[[EthernetUDP.begin()| begin()]]
  
:-[[EthernetUDP:read()| read()]]
+
:-[[EthernetUDP.read()| read()]]
  
:-[[EthernetUDP:write()| write()]]
+
:-[[EthernetUDP.write()| write()]]
  
:-[[EthernetUDP:beginPacket()| beginPacket()]]
+
:-[[EthernetUDP.beginPacket()| beginPacket()]]
  
:-[[EthernetUDP:endPacket()| endPacket()]]
+
:-[[EthernetUDP.endPacket()| endPacket()]]
  
:-[[EthernetUDP:parsePacket()| parsePacket()]]
+
:-[[EthernetUDP.parsePacket()| parsePacket()]]
  
:-[[EthernetUDP:available()| available()]]
+
:-[[EthernetUDP.available()| available()]]
  
:-[[EthernetUDP:stop()| stop()]]
+
:-[[EthernetUDP.stop()| stop()]]
  
:-[[EthernetUDP:remoteIP()| remoteIP()]]
+
:-[[EthernetUDP.remoteIP()| remoteIP()]]
  
:-[[EthernetUDP:remotePort()| remotePort()]]
+
:-[[EthernetUDP.remotePort()| remotePort()]]
  
 
|width="10%" valign="top" align="left"|
 
|width="10%" valign="top" align="left"|

2015年7月23日 (四) 23:08的最后版本


With the Arduino Ethernet Shield, this library allows an Arduino board to connect to the internet. It can serve as either a server accepting incoming connections or a client making outgoing ones. The library supports up to four concurrent connection (incoming or outgoing or a combination).

Arduino communicates with the shield using the SPI bus. This is on digital pins 11, 12, and 13 on the Uno and pins 50, 51, and 52 on the Mega. On both boards, pin 10 is used as SS. On the Mega, the hardware SS pin, 53, is not used to select the W5100, but it must be kept as an output or the SPI interface won't work.


Arduino uno ethernet pins.png


Arduino mega ethernet pins.png




Examples


- ChatServer : set up a simple chat server.
- WebClient : make a HTTP request.
- WebClientRepeating : Make repeated HTTP requests.
- WebServer : host a simple HTML page that displays analog sensor values.
- BarometricPressureWebServer : outputs the values from a barometric pressure sensor as a web page.
- UDPSendReceiveString : Send and receive text strings via UDP.
- UdpNtpClient : Query a Network Time Protocol (NTP) server using UDP.
- DnsWebClient : DNS and DHCP-based Web client.
- DhcpChatServer : A simple DHCP Chat Server
- DhcpAddressPrinter : Get an IP address via DHCP and print it out
- TelnetClient : A simple Telnet client




Ethernet class

The Ethernet class initializes the ethernet library and network settings.

- begin()
- localIP()
- maintain()


IPAddress class

The IPAddress class works with local and remote IP addressing.

- IPAddress()


Server class

The Server class creates servers which can send data to and receive data from connected clients (programs running on other computers or devices).

- Server()
- EthernetServer()
- begin()
- available()
- write()
- print
- println()


Client class

The client class creates clients that can connect to servers and send and receive data.

- Client()
- EthernetClient()
- if (EthernetClient)
- connected()
- connect()
- write
- print
- println()
- available()
- read()
- flush()
- stop()


EthernetUDP class

The EthernetUDP class enables UDP message to be sent and received.

- begin()
- read()
- write()
- beginPacket()
- endPacket()
- parsePacket()
- available()
- stop()
- remoteIP()
- remotePort()




返回Arduino库菜单

返回首页

更多建议和问题欢迎反馈至 YFRobot论坛