A RPC example usage program.
Fork of RPC_Serial by
main.cpp
- Committer:
- dhcabinian
- Date:
- 2016-03-15
- Revision:
- 6:cb40d6349b96
- Parent:
- 5:59421f613a13
- Child:
- 7:d72b60abcab5
File content as of revision 6:cb40d6349b96:
#include "mbed.h"
#include "mbed_rpc.h"
/**
* This example program has been updated to use the RPC implementation in the new mbed libraries.
* This example shows the uses of the RPCDigitalOut wrapper class
*/
//Use the RPC enabled wrapped class - see RpcClasses.h for more info
RpcDigitalOut mbedled(LED1,"mbedled");
RpcAnalogIn sw(p8, "switch");
RpcPwmOut led(p21, "pwmled");
Serial pc(USBTX, USBRX);
int main() {
char buf[256], outbuf[256];
while(1) {
pc.gets(buf, 256);
//Call the static call method on the RPC class
RPC::call(buf, outbuf);
pc.printf("%s\n", outbuf);
}
}
