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.
Fork of RPC_Serial by
main.cpp
00001 #include "mbed.h" 00002 #include "mbed_rpc.h" 00003 00004 /** 00005 * This example program has been updated to use the RPC implementation in the new mbed libraries. 00006 * This example shows the uses of the RPCDigitalOut wrapper class 00007 */ 00008 00009 //Use the RPC enabled wrapped class - see RpcClasses.h for more info 00010 RpcDigitalOut mbedled(LED1,"mbedled"); 00011 RpcDigitalIn sw(p8, "switch"); 00012 RpcPwmOut led(p21, "pwmled"); 00013 Serial pc(USBTX, USBRX); 00014 00015 int main() { 00016 00017 char buf[256], outbuf[256]; 00018 while(1) { 00019 pc.gets(buf, 256); 00020 //Call the static call method on the RPC class 00021 RPC::call(buf, outbuf); 00022 pc.printf("%s\n", outbuf); 00023 } 00024 }
Generated on Sun Jul 17 2022 01:41:07 by
1.7.2
