Sunteți pe pagina 1din 3

RE%20PROFILE:PUBLIC&RESPONSE_TYPE=TOKEN&REDIRECT_URI=HTTPS%3A%2F%2FWWW.ARDUINO.

CC)

Reference   Language (//www.arduino.cc/en/Reference/HomePage) | Libraries


(//www.arduino.cc/en/Reference/Libraries) | Comparison (//www.arduino.cc/en/Reference/Comparison) | Changes
(//www.arduino.cc/en/Reference/Changes)

Ethernet / Ethernet 2 library


These libraries are designed to work with the Arduino Ethernet
Shield (Ethernet.h) or the Arduino Ethernet Shield 2 and Leonardo Ethernet class
Ethernet (Ethernet2.h). The libraries are allow an Arduino board to
connect to the internet. The board can serve as either a server The Ethernet class initializes the ethernet library and network
accepting incoming connections or a client making outgoing ones. settings.
The libraries support up to four concurrent connection (incoming - begin() (//www.arduino.cc/en/Reference/EthernetBegin)
or outgoing or a combination). Ethernet library (Ethernet.h)
manages the W5100 chip, while Ethernet2 library (Ethernet2.h) - localIP() (//www.arduino.cc/en/Reference/EthernetLocalIP)
manages the W5500 chip; all the functions remain the same.
- maintain()
Changing the library used allows to port the same code from
Arduino Ethernet Shield to Arduino Ethernet 2 Shield or Arduino (//www.arduino.cc/en/Reference/EthernetMaintain)
Leonardo Ethernet and vice versa.
Arduino communicates with the shield using the SPI bus. This is on IPAddress class
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 The IPAddress class works with local and remote IP addressing.
hardware SS pin, 53, is not used to select the W5100, but it must be - IPAddress()
kept as an output or the SPI interface won't work. (//www.arduino.cc/en/Reference/EthernetIPAddress)

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 (//www.arduino.cc/en/Reference/ServerConstructor)
- EthernetServer()
(//www.arduino.cc/en/Reference/EthernetServer)
- begin() (//www.arduino.cc/en/Reference/ServerBegin)
- available()
(//www.arduino.cc/en/Reference/ServerAvailable)
- write() (//www.arduino.cc/en/Reference/ServerWrite)
- print() (//www.arduino.cc/en/Reference/ServerPrint)
- println() (//www.arduino.cc/en/Reference/ServerPrintln)

Client class
The client class creates clients that can connect to servers and
send and receive data.
- Client (//www.arduino.cc/en/Reference/ClientConstructor)
- EthernetClient()
(//www.arduino.cc/en/Reference/EthernetClient)
- if (EthernetClient)
(//www.arduino.cc/en/Reference/IfEthernetClient)
- connected()
(//www.arduino.cc/en/Reference/ClientConnected)
- connect() (//www.arduino.cc/en/Reference/ClientConnect)
- write() (//www.arduino.cc/en/Reference/ClientWrite)
- print() (//www.arduino.cc/en/Reference/ClientPrint)
- println() (//www.arduino.cc/en/Reference/ClientPrintln)
- available() (//www.arduino.cc/en/Reference/ClientAvailable)
- read() (//www.arduino.cc/en/Reference/ClientRead)
Examples
- flush() (//www.arduino.cc/en/Reference/ClientFlush)
- ChatServer (//www.arduino.cc/en/Tutorial/ChatServer): set
- stop() (//www.arduino.cc/en/Reference/ClientStop)
up a simple chat server.
- WebClient (//www.arduino.cc/en/Tutorial/WebClient): make a
EthernetUDP class
HTTP request.
The EthernetUDP class enables UDP message to be sent and
- WebClientRepeating received.
(//www.arduino.cc/en/Tutorial/WebClientRepeating): Make - begin()
repeated HTTP requests. (//www.arduino.cc/en/Reference/EthernetUDPBegin)
- WebServer (//www.arduino.cc/en/Tutorial/WebServer): host a
- read() (//www.arduino.cc/en/Reference/EthernetUDPRead)
simple HTML page that displays analog sensor values.
- write()
- BarometricPressureWebServer (//www.arduino.cc/en/Reference/EthernetUDPWrite)
(//www.arduino.cc/en/Tutorial/BarometricPressureWebServer):
- beginPacket()
outputs the values from a barometric pressure sensor as a
(//www.arduino.cc/en/Reference/EthernetUDPBeginPacket)
web page.
- endPacket()
- UDPSendReceiveString
(//www.arduino.cc/en/Reference/EthernetUDPEndPacket)
(//www.arduino.cc/en/Tutorial/UDPSendReceiveString): Send
and receive text strings via UDP. - parsePacket()
(//www.arduino.cc/en/Reference/EthernetUDPParsePacket)
- UdpNtpClient (//www.arduino.cc/en/Tutorial/UdpNtpClient):
- available()
Query a Network Time Protocol (NTP) server using UDP.
(//www.arduino.cc/en/Reference/EthernetUDPAvailable)
- DnsWebClient (//www.arduino.cc/en/Tutorial/DnsWebClient):
DNS and DHCP-based Web client. - stop() (//www.arduino.cc/en/Reference/EthernetUDPStop)

- DhcpChatServer - remoteIP()

(//www.arduino.cc/en/Tutorial/DhcpChatServer): A simple (//www.arduino.cc/en/Reference/EthernetUDPRemoteIP)

DHCP Chat Server - remotePort()

- DhcpAddressPrinter (//www.arduino.cc/en/Reference/EthernetUDPRemotePort)

(//www.arduino.cc/en/Tutorial/DhcpAddressPrinter): Get an
IP address via DHCP and print it out
- TelnetClient (//www.arduino.cc/en/Tutorial/TelnetClient): A
simple Telnet client

Reference Home (//www.arduino.cc/en/Reference/HomePage)

Corrections, suggestions, and new documentation should be posted to the Forum


(http://arduino.cc/forum/index.php/board,23.0.html).

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License
(http://creativecommons.org/licenses/by-sa/3.0/). Code samples in the reference are released into the public domain.
Share

NEWSLETTER

ENTER YOUR EMAIL TO SIGN UP SUBSCRIBE

Copyright Notice (//www.arduino.cc/en/Main/CopyrightNotice)

Contact Us (//www.arduino.cc/en/Main/ContactUs)

About Us (//www.arduino.cc/en/Main/AboutUs)

Careers (//www.arduino.cc/Careers)
© 2017 Arduino

(https://www.facebook.com/official.arduino)
(https://twitter.com/arduino)
(https://plus.google.com/+Arduino)
(https://www.instagram.com/arduino.cc/)
(https://github.com/arduino/)
(https://www.flickr.com/photos/arduino_cc)
(https://www.youtube.com/user/arduinoteam)

S-ar putea să vă placă și