example serial interface for python and LPC11U24 - analogin and pwm working
Fork of RPC_Serial_new by
Diff: main.cpp
- Revision:
- 6:f83b71016626
- Parent:
- 5:1caee8f66e14
--- a/main.cpp Thu Jun 26 14:49:25 2014 +0000 +++ b/main.cpp Sun Jul 27 15:44:59 2014 +0000 @@ -5,12 +5,16 @@ int main() { // setup the classes that can be created dynamically - RPC::add_rpc_class<RpcAnalogOut>(); - RPC::add_rpc_class<RpcAnalogOut>(); + RPC::add_rpc_class<RpcAnalogIn>(); + RPC::add_rpc_class<RpcDigitalIn>(); RPC::add_rpc_class<RpcDigitalOut>(); + RPC::add_rpc_class<RpcPwmOut>(); + + RpcAnalogIn rpc_ain(p19, "ain"); RpcDigitalOut rpc_led(LED1, "led"); + RpcPwmOut rpc_pwmout(p10, "pwmout"); // receive commands, and send back the responses char buf[256], outbuf[256]; @@ -21,3 +25,11 @@ pc.printf("%s\n", outbuf); } } +/* +void myRPCAnalogIn(Arguments* input, Reply* output){ + output->putData(ain.read()); + led3 = 1; + wait(2); + led3 = 0; +} +*/ \ No newline at end of file