A demonstration program for R/C servo I/F board. ( http://mbed.org/users/shintamainjp/notebook/starboard-orange_rcservo-ifbrd_en/ )

Dependencies:   mbed TextLCD_SR4 NetServicesSource

Files at this revision

API Documentation at this revision

Comitter:
shintamainjp
Date:
Tue Oct 26 14:41:57 2010 +0000
Commit message:
First version.

Changed in this revision

extlib/FATFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
extlib/NetServicesSource.lib Show annotated file Show diff for this revision Revisions of this file
extlib/RPCInterface.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
mylib/TextLCD_SR4.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 55733c65ccca extlib/FATFileSystem.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extlib/FATFileSystem.lib	Tue Oct 26 14:41:57 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_unsupported/code/fatfilesystem/
\ No newline at end of file
diff -r 000000000000 -r 55733c65ccca extlib/NetServicesSource.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extlib/NetServicesSource.lib	Tue Oct 26 14:41:57 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/NetServicesSource/#da4498f591ee
diff -r 000000000000 -r 55733c65ccca extlib/RPCInterface.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extlib/RPCInterface.lib	Tue Oct 26 14:41:57 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/MichaelW/code/RPCInterface/#05f0d66bee57
diff -r 000000000000 -r 55733c65ccca main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Oct 26 14:41:57 2010 +0000
@@ -0,0 +1,52 @@
+
+#include "mbed.h"
+#include "EthernetNetIf.h"
+#include "HTTPServer.h"
+#include "TextLCD_SR4.h"
+
+LocalFileSystem fs_local("local");
+TextLCD_SR4 lcd(p29, p30, p28, p27);
+EthernetNetIf eth;
+HTTPServer svr;
+
+int main() {
+    Base::add_rpc_class<AnalogIn>();
+    Base::add_rpc_class<AnalogOut>();
+    Base::add_rpc_class<DigitalIn>();
+    Base::add_rpc_class<DigitalOut>();
+    Base::add_rpc_class<DigitalInOut>();
+    Base::add_rpc_class<PwmOut>();
+    Base::add_rpc_class<Timer>();
+    Base::add_rpc_class<BusOut>();
+    Base::add_rpc_class<BusIn>();
+    Base::add_rpc_class<BusInOut>();
+    Base::add_rpc_class<Serial>();
+
+    lcd.cls();
+    lcd.printf("Setting up...");
+    EthernetErr ethErr = eth.setup();
+    if (ethErr) {
+        lcd.cls();
+        lcd.printf("Error (%d)", ethErr);
+        error("Error %d in setup.\n", ethErr);
+        return -1;
+    } else {
+        IpAddr addr = eth.getIp();
+        lcd.cls();
+        lcd.printf("Network address");
+        lcd.locate(0, 1);
+        lcd.printf("%3d.%3d.%3d.%3d", addr[0], addr[1], addr[2], addr[3]);
+    }
+
+    FSHandler::mount("/local", "/");  //Mount /local path on web root path
+    svr.addHandler<FSHandler>("/");      //Default handler
+    svr.addHandler<RPCHandler>("/rpc");
+    svr.bind(80);
+
+    while (true) {
+        Net::poll();
+        wait_ms(1);
+    }
+
+    return 0;
+}
diff -r 000000000000 -r 55733c65ccca mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Oct 26 14:41:57 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e
diff -r 000000000000 -r 55733c65ccca mylib/TextLCD_SR4.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mylib/TextLCD_SR4.lib	Tue Oct 26 14:41:57 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/shintamainjp/code/TextLCD_SR4/#e768257aba09