Prints MAC address of an mbed LPC1768 on the USB virtual com port

Dependencies:   mbed

Committer:
4180_1
Date:
Fri Jun 23 00:59:43 2017 +0000
Revision:
0:1c0018938474
ver 1.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
4180_1 0:1c0018938474 1 #include "mbed.h"
4180_1 0:1c0018938474 2 extern "C" void mbed_mac_address(char *s);
4180_1 0:1c0018938474 3 //prints MAC address - handy if MAC is needed for ethernet network setup
4180_1 0:1c0018938474 4 Serial pc(USBTX,USBRX);
4180_1 0:1c0018938474 5 int main() {
4180_1 0:1c0018938474 6 char mac[6];
4180_1 0:1c0018938474 7 mbed_mac_address(mac);
4180_1 0:1c0018938474 8 pc.printf("mbed MAC address is %02x:%02x:%02x:%02x:%02x:%02x\n\r", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
4180_1 0:1c0018938474 9 }