![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
An RPC program that reads data from an Accelerometer(MMA7660) on the Mbed developement board and sends it to the PC trough a serial connection
Dependencies: MMA7660 RPCInterface mbed
Fork of RPC_Serial by
Diff: main.cpp
- Revision:
- 1:de34af25056a
- Parent:
- 0:78952cd3935b
- Child:
- 2:c079ba242f7c
--- a/main.cpp Tue Aug 24 14:25:07 2010 +0000 +++ b/main.cpp Tue Aug 24 15:15:44 2010 +0000 @@ -1,9 +1,8 @@ #include "mbed.h" #include "rpc.h" - Serial pc(USBTX, USBRX); - int main() { + // setup the classes that can be created dynamically Base::add_rpc_class<AnalogIn>(); Base::add_rpc_class<AnalogOut>(); Base::add_rpc_class<DigitalIn>(); @@ -16,7 +15,7 @@ Base::add_rpc_class<BusIn>(); Base::add_rpc_class<BusInOut>(); Base::add_rpc_class<Serial>(); - + // receive commands, and send back the responses char buf[256], outbuf[256]; while(1) { pc.gets(buf, 256);