Report
5 years, 9 months ago.  This question has been closed. Reason: Found issue and fixed it

Creating new RpcDigitalOut via python

Hello All,

I am trying to create a new object of RpcDigitalOut via python serial interface but can't get it working...

My python code looks like this

 ser = serial.Serial("COM6",9600)
redLED = "/RpcDigitalOut/new LED3 redLED\n"
redLEDOn = "/redLED/write 1\n"
redLEDOff = "/redLED/write 0\n"
otheron = "/lit/write 0\n"
otheroff = "/lit/write 1\n"
ser.write(redLED)
while(True):
    sleep(1) 
    ser.write(redLEDOn)
    ser.write(otheron)
    sleep(1)
    ser.write(redLEDOff)
    ser.write(otheroff)

In Mbed code I have added

RPC::add_rpc_class<RpcDigitalOut>();
RpcDigitalOut ligt(LED4, "lit");

I can see LED4 blinking but not LED3 :(

All suugestions are welcome.

Regards, Hemant Kapoor

Finally found the issue... It is with RpcDigitalOut class in RpcClasses.h...

static rpc_class c = {"DigitalOut", funcs, NULL};

This error is with all the classes :(

It should be

static rpc_class c = {"RpcDigitalOut", funcs, NULL};
posted by Hemant Kapoor 18 Nov 2013