example serial interface for python and LPC11U24

Dependencies:   mbed-rpc mbed

Fork of RPC_Serial by Michael Walker

Committer:
MichaelW
Date:
Tue Aug 24 14:25:07 2010 +0000
Revision:
0:78952cd3935b
Child:
1:de34af25056a

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MichaelW 0:78952cd3935b 1 #include "mbed.h"
MichaelW 0:78952cd3935b 2 #include "rpc.h"
MichaelW 0:78952cd3935b 3
MichaelW 0:78952cd3935b 4 Serial pc(USBTX, USBRX);
MichaelW 0:78952cd3935b 5
MichaelW 0:78952cd3935b 6 int main() {
MichaelW 0:78952cd3935b 7 Base::add_rpc_class<AnalogIn>();
MichaelW 0:78952cd3935b 8 Base::add_rpc_class<AnalogOut>();
MichaelW 0:78952cd3935b 9 Base::add_rpc_class<DigitalIn>();
MichaelW 0:78952cd3935b 10 Base::add_rpc_class<DigitalOut>();
MichaelW 0:78952cd3935b 11 Base::add_rpc_class<DigitalInOut>();
MichaelW 0:78952cd3935b 12 Base::add_rpc_class<PwmOut>();
MichaelW 0:78952cd3935b 13 Base::add_rpc_class<Timer>();
MichaelW 0:78952cd3935b 14 Base::add_rpc_class<SPI>();
MichaelW 0:78952cd3935b 15 Base::add_rpc_class<BusOut>();
MichaelW 0:78952cd3935b 16 Base::add_rpc_class<BusIn>();
MichaelW 0:78952cd3935b 17 Base::add_rpc_class<BusInOut>();
MichaelW 0:78952cd3935b 18 Base::add_rpc_class<Serial>();
MichaelW 0:78952cd3935b 19
MichaelW 0:78952cd3935b 20 char buf[256], outbuf[256];
MichaelW 0:78952cd3935b 21 while(1) {
MichaelW 0:78952cd3935b 22 pc.gets(buf, 256);
MichaelW 0:78952cd3935b 23 rpc(buf, outbuf);
MichaelW 0:78952cd3935b 24 pc.printf("%s\n", outbuf);
MichaelW 0:78952cd3935b 25 }
MichaelW 0:78952cd3935b 26 }