mbed and Processing over USB

13 Nov 2011

Hi there. I am after a bit of help. I am trying to send a char or byte etc from processing to the mbed via USB. I have looked at RPC and managed to turn an led on and off etc. But i need to send actual data to a variable on the hardware for further processing to control some time critical motors.

If any one can post a quick example that would be great.

13 Nov 2011

Just forgot here is my code.

Create the interface on the USB Serial Port SerialRPCInterface SerialInterface(USBTX, USBRX);

Create float variables

float myValue = 0;

Make these variables accessible over RPC by attaching them to an RPCVariable

RPCVariable<float> rpcMyValue(&myValueP, "myValue"); int main(){

float myValue;

while(1){

myValue = myValueP.read();

} }