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
00001 #include "mbed.h" 00002 #include "EthernetNetIf.h" 00003 #include "TinyResolver.h" 00004 00005 DigitalOut myled(LED1); 00006 Serial pc(USBTX, USBRX); 00007 EthernetNetIf eth; 00008 00009 int main () { 00010 EthernetErr ethErr; 00011 uint32_t addr; 00012 00013 myled = 1; 00014 00015 ethErr = eth.setup(); 00016 if(ethErr) { 00017 return -1; 00018 } 00019 00020 getHostByName(IpAddr(192,168,1,1), "mbed.org", &addr); 00021 00022 printf("IP address: %d.%d.%d.%d\r\n", (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff); 00023 00024 myled = 0; 00025 return 0; 00026 }
Generated on Wed Jul 13 2022 09:29:18 by
1.7.2