Ethernet.localIP()

[Ethernet]

説明

Obtains the IP address of the 86Duino. Useful when the address is auto-assigned through DHCP.

Syntax

Ethernet.localIP();

Parameters

none

Returns

the IP address

Example

#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() {
 
}

Libraries Reference Home

86Duino のリファレンスのテキストは Arduino レファレンス を編集したもので、 Creative Commons Attribution-ShareAlike 3.0 License下でライセンスされています。リファレンス内のコードサンプルはパブリックドメインとして公開されています。

コメントする

上部へスクロール