[Ethernet]
描述
Obtains the MAC (Media access control) address of the 86Duino. This function is available from 86Duino Coding 102.
語法
Ethernet.localMAC();
參數
無
回傳
an array of 6 bytes that contains the MAC address of the 86Duino
範例
#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() {
}函式庫參考主頁面
86Duino 參考的文本是根據 知識共享署名-相同方式分享 3.0 許可證,部分文本是從 Arduino 參考 修改的。 參考中的代碼示例已發佈到公共領域。