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: C12832_lcd EthernetInterface HttpServer mbed-rpc mbed-rtos mbed
Fork of HttpServerSample by
Diff: main.cpp
- Revision:
- 4:155c6ff99458
- Parent:
- 3:5758cfefe980
- Child:
- 5:bfa9878aa274
--- a/main.cpp Thu Feb 20 13:12:46 2014 +0000
+++ b/main.cpp Fri Feb 21 07:42:20 2014 +0000
@@ -1,16 +1,18 @@
//#define DNS_SERVER_ADDRESS(ipaddr) (ip4_addr_set_u32(ipaddr, ipaddr_addr("208.67.222.222"))) /* resolver1.opendns.com */
-#define __DEBUG
#include "mbed.h"
#include "rtos.h"
#include "EthernetInterface.h"
#include "HTTPServer.h"
#include "mbed_rpc.h"
-
+#include "TextLCD.h"
EthernetInterface eth;
DigitalOut led4(LED4);
LocalFileSystem local("local");
+ void LcdWrite(Arguments* arg, Reply* r); //ADD Here!!
+
+TextLCD lcd(p24, p26, p27, p28, p29, p30);
void aliveState(void const *args) {
while (true) {
@@ -24,9 +26,12 @@
printf("********* PROGRAM START ***********\r\n");
Thread thread(aliveState);
RPC::add_rpc_class<RpcDigitalOut>();
- RPC::construct<RpcDigitalOut, PinName, const char*>(LED1, "led1"); // mbed LED
+ RPC::construct<RpcDigitalOut, PinName, const char*>(LED1, "led1");
RPC::construct<RpcDigitalOut, PinName, const char*>(LED2, "led2");
RPC::construct<RpcDigitalOut, PinName, const char*>(LED3, "led3");
+ RPCFunction rpcFunc(LcdWrite, "LcdWrite"); //ADD Here!!
+ lcd.cls();
+ lcd.locate(0,0);
printf("EthernetInterface Setting up...\r\n");
if(eth.init()!=0) { //for DHCP Server
@@ -47,7 +52,13 @@
FSHandler::mount("/local", "/");
HTTPServerAddHandler<FSHandler>("/");
HTTPServerAddHandler<RPCHandler>("/rpc");
-
+ lcd.locate(0,0);
+ lcd.printf("%s",eth.getIPAddress());
HTTPServerStart(80);
}
+void LcdWrite(Arguments* arg, Reply* r) //ADD Here!!
+{
+ lcd.locate(0,1);
+ lcd.printf("%s",arg->argv[0]);
+}
