Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbed-rtos EthernetInterface
Diff: mainETH_1.cpp
- Revision:
- 15:066e07dc9beb
- Parent:
- 11:59dcefdda506
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mainETH_1.cpp Wed Jan 20 05:03:45 2021 +0000 @@ -0,0 +1,20 @@ +//プログラム eth-1.cpp +#include "mbed.h" +#include "EthernetInterface.h" + +Serial pc(USBTX,USBRX); +EthernetInterface eth; + +int main() +{ + eth.init(); //Use DHCP + pc.printf("MAC Address is %s\n", eth.getMACAddress()); + + eth.connect(); + pc.printf("IP Address is %s\n", eth.getIPAddress()); + pc.printf("Network Mask is %s\n", eth.getNetworkMask()); + + eth.disconnect(); + +} +