David Taylor / Mbed 2 deprecated DigitalOut

Dependencies:   mbed-rpc mbed

Files at this revision

API Documentation at this revision

Comitter:
Bear05
Date:
Wed Apr 09 16:39:56 2014 +0000
Commit message:
LabView compatible sigital out on FRDM KL25Z platform;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rpc.lib 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Apr 09 16:39:56 2014 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "mbed_rpc.h"
+
+Serial pc(USBTX, USBRX);
+
+char buf[RPC_MAX_STRING], outbuf[RPC_MAX_STRING];
+PwmOut led(LED3);
+
+int main()
+{
+    led = 0.95;
+
+// define classes
+    RPC::add_rpc_class<RpcDigitalOut>();
+
+// define outputs
+    RpcDigitalOut rpc_rtng1(PTE5, "one");
+    RpcDigitalOut rpc_rtng2(PTE3, "two");
+    RpcDigitalOut rpc_En1(PTE4, "Enable1");
+    RpcDigitalOut rpc_fan(PTB9, "three");
+    RpcDigitalOut rpc_En2(PTB8, "Enable2");
+    strcpy(buf, "/one/write 0");
+    RPC::call(buf, outbuf);
+    strcpy(buf, "/two/write 0");
+    RPC::call(buf, outbuf);
+    strcpy(buf, "/Enable1/write 0");
+    RPC::call(buf, outbuf);
+    strcpy(buf, "/three/write 0");
+    RPC::call(buf, outbuf);
+    strcpy(buf, "/Enable2/write 0");
+    RPC::call(buf, outbuf);
+
+// receive commands, and send back the responses
+    while(1) {
+        pc.gets(buf, 256);
+        RPC::call(buf, outbuf);
+        pc.printf("%s\n", outbuf);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rpc.lib	Wed Apr 09 16:39:56 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Bear05/code/mbed-rpc/#f462916424ea
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Apr 09 16:39:56 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file