[Ethernet]
描述
Obtains the IP address of the 86Duino. Useful when the address is auto-assigned through DHCP.
語法
Ethernet.localIP();
參數
無
回傳
the IP address
範例
#include <Ethernet.h> void setup() { // start the serial library: Serial.begin(9600); // start the Ethernet connection: if (Ethernet.begin() == 0) { Serial.println("Failed to configure Ethernet using DHCP"); // no point in carrying on, so do nothing forevermore: for(;;) ; } // print your local IP address: Serial.println(Ethernet.localIP()); } void loop() { }
函式庫參考主頁面
86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。