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: EthernetNetIf mbed
main.cpp
- Committer:
- okini3939
- Date:
- 2011-07-21
- Revision:
- 0:477d4e2f281a
File content as of revision 0:477d4e2f281a:
#include "mbed.h"
#include "EthernetNetIf.h"
#include "TinyResolver.h"
DigitalOut myled(LED1);
Serial pc(USBTX, USBRX);
EthernetNetIf eth;
int main () {
EthernetErr ethErr;
uint32_t addr;
myled = 1;
ethErr = eth.setup();
if(ethErr) {
return -1;
}
getHostByName(IpAddr(192,168,1,1), "mbed.org", &addr);
printf("IP address: %d.%d.%d.%d\r\n", (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff);
myled = 0;
return 0;
}