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.
Revision 0:10ec212e4043, committed 2014-04-09
- 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
--- /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