Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years, 7 months ago.
Could not run Example 12.3 on Ethernet IP address request from Textbook
I tried to run the example below from Toulson and Wilmhurst's Fast and Effective...., 2nd edition, slightly modified, but received error messages, see attached file. (The message didn't print completely on the terminal.) Please let me know what's wrong if possible. Thanks!
Program example 12.3 from Fast and Effective... text, 2nd ed.
- include "mbed.h"
- include "EthernetInterface.h" Must import this library first!
EthernetInterface eth;
Serial pc(USBTX, USBRX);
int main() {
pc.printf("Hello\n");
pc.printf("About to call eth.init()\n");
eth.init();
eth.connect();
pc.printf("IP address is %s\n", eth.getIPAddress());
eth.disconnect();
}
Which target and version of the Mbed library are you using Mbed-os or Mbed(os2) with Mbed-RTOS? and can you post your code here using ;
<<code title=>> your code here <</code>>
See editing tips.
I use EthernetInterface without any problems with both libraries.
posted by Paul Staron 20 Apr 2019