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.
main.cpp
00001 #include "mbed.h" 00002 #include "EthernetNetIf.h" 00003 #include "HTTPServer.h" 00004 #include "TextLCD.h" 00005 00006 00007 EthernetNetIf eth; 00008 HTTPServer svr; 00009 00010 DigitalOut led1(LED1); 00011 TextLCD lcd(p14, p15, p16, p17, p18, p19); 00012 00013 int main() { 00014 lcd.printf("Setting up...\n"); 00015 EthernetErr ethErr = eth.setup(); 00016 if(ethErr) 00017 { 00018 lcd.printf("Error %d in setup.\n", ethErr); 00019 return -1; 00020 } 00021 lcd.printf("Setup OK\n"); 00022 00023 svr.addHandler<SimpleHandler>("/"); //Default handler 00024 svr.bind(80); 00025 00026 lcd.printf("Listening...\n"); 00027 00028 Timer tm; 00029 tm.start(); 00030 //Listen indefinitely 00031 while(true) 00032 { 00033 Net::poll(); 00034 if(tm.read()>.5) 00035 { 00036 led1=!led1; //Show that we are alive 00037 tm.start(); 00038 } 00039 } 00040 00041 00042 }
Generated on Tue Jul 12 2022 19:23:03 by
1.7.2