[Ethernet]
Description
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
The text of the 86Duino reference is a modification of the Arduino reference and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.