Ethernet.localMAC()

[Ethernet]

説明

Obtains the MAC (Media access control) address of the 86Duino. This function is available from 86Duino Coding 102.

Syntax

Ethernet.localMAC();

Parameters

none

Returns

an array of 6 bytes that contains the MAC address of the 86Duino

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 MAC address:
  byte *mac = Ethernet.localMAC();
  for (int i=0; i<6; i++)
  {
    Serial.print(mac[i], HEX);
    Serial.print(" ");
  }
}
 
void loop() {
 
}

Libraries Reference Home

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

コメントする

上部へスクロール