example serial interface for python and LPC11U24 - analogin and pwm working
Fork of RPC_Serial_new by
main.cpp
- Committer:
- bhavik
- Date:
- 2014-06-20
- Revision:
- 3:726cfc72fe9a
- Parent:
- 2:fadccef926e4
- Child:
- 4:726b4e996614
File content as of revision 3:726cfc72fe9a:
#include "mbed.h" #include "mbed_rpc.h" Serial pc(USBTX, USBRX); int main() { // setup the classes that can be created dynamically /*RPC::add_rpc_class<AnalogIn>(); //RPC::add_rpc_class<AnalogOut>(); RPC::add_rpc_class<DigitalIn>(); RPC::add_rpc_class<DigitalOut>(); RPC::add_rpc_class<DigitalInOut>(); RPC::add_rpc_class<PwmOut>(); RPC::add_rpc_class<Timer>(); RPC::add_rpc_class<SPI>(); RPC::add_rpc_class<BusOut>(); RPC::add_rpc_class<BusIn>(); RPC::add_rpc_class<BusInOut>(); RPC::add_rpc_class<Serial>();*/ RPC::add_rpc_class<RpcDigitalIn>(); // receive commands, and send back the responses char buf[256], outbuf[256]; while(1) { pc.gets(buf, 256); RPC::call(buf, outbuf); pc.printf("%s\n", outbuf); } }