Oscar de Jesus Vasquez / Mbed 2 deprecated RPC_Serial_OVFZ

Dependencies:   mbed-rpc mbed

Fork of RPC_Serial by Michael Walker

Files at this revision

API Documentation at this revision

Comitter:
oscarvzfz
Date:
Mon Jul 21 04:17:12 2014 +0000
Parent:
1:de34af25056a
Child:
3:66aaebc365d3
Commit message:
RPC and SRF05

Changed in this revision

RPCInterface.lib Show annotated file Show diff for this revision Revisions of this file
SRF05.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RPCInterface.lib	Mon Jul 21 04:17:12 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/MichaelW/code/RPCInterface/#682c65afe534
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SRF05.lib	Mon Jul 21 04:17:12 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/SRF05/#e758665e072c
--- a/main.cpp	Tue Aug 24 15:15:44 2010 +0000
+++ b/main.cpp	Mon Jul 21 04:17:12 2014 +0000
@@ -1,6 +1,13 @@
 #include "mbed.h"
+#include "SRF05.h"
+#include "RPCVariable.h"
 #include "rpc.h"
+
 Serial pc(USBTX, USBRX);
+SRF05 srf(p13, p14);
+float f;
+
+
 int main() {
     // setup the classes that can be created dynamically
     Base::add_rpc_class<AnalogIn>();
@@ -15,9 +22,11 @@
     Base::add_rpc_class<BusIn>();
     Base::add_rpc_class<BusInOut>();
     Base::add_rpc_class<Serial>();
+    RPCVariable<float> rpc_f(&f, "f");
     // receive commands, and send back the responses
     char buf[256], outbuf[256];
     while(1) {
+        f=srf.read();
         pc.gets(buf, 256);
         rpc(buf, outbuf); 
         pc.printf("%s\n", outbuf);